Agent UX: show clear hint for missing provider API keys#31554
Agent UX: show clear hint for missing provider API keys#31554liuxiaopai-ai wants to merge 1 commit intoopenclaw:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4831cb36d4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| | { kind: "final"; payload: ReplyPayload }; | ||
|
|
||
| function resolveMissingApiKeyProvider(message: string): string | null { | ||
| const match = message.match(/No API key found for provider "([^"]+)"/i); |
There was a problem hiding this comment.
Restrict missing-key hint to direct auth failures
resolveMissingApiKeyProvider does an unanchored substring match against the entire error text, so it also matches fallback summaries that include a single No API key found... attempt among other failures; runWithModelFallback emits combined messages like All models failed ... | ..., which means a primary outage/other error can be misreported to users as a missing-key problem and send them to openclaw configure even though that won’t fix the run. Gate this path to direct single-attempt auth errors (or parse structured attempt reasons) before replacing the final message.
Useful? React with 👍 / 👎.
Greptile SummaryThis PR improves the user experience when model selection fails due to missing provider API keys by showing a clear, actionable error message instead of a verbose fallback-chain error. Changes made:
Implementation quality:
The change is well-scoped, improves onboarding UX, and maintains backward compatibility by only affecting the final user-facing error text. Confidence Score: 5/5
Last reviewed commit: 4831cb3 |
Summary
/modelselection fails due to missing provider credentials, users see a long fallback-chain error blob that is hard to act on.No API key found for provider "..."failures and show a concise actionable hint (openclaw configure) in the user-facing final error text.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Missing API key for provider "<provider>"openclaw configureSecurity Impact (required)
No)No)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
No API key found for provider "anthropic".runReplyAgentpath withonAgentRunStartcallback.Expected
Actual
Evidence
Human Verification (required)
pnpm test src/auto-reply/reply/agent-runner.misc.runreplyagent.test.tspnpm format:checkpnpm check(known unrelated existing failures in other areas).Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
4831cb36d.src/auto-reply/reply/agent-runner-execution.tssrc/auto-reply/reply/agent-runner.misc.runreplyagent.test.tsCHANGELOG.mdRisks and Mitigations