Repository navigation
fix: explain when a required account cannot serve a model route - #208739
Conversation
Keep the profile-specific diagnostic separate from the message sent to the requester. Explain the route and account classes without sending account identifiers or suggesting a fresh sign-in. Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: e1dbe0eb-cea3-4dae-a01a-a9039937a650
|
🦞👀 |
|
Main vs fix on CrabBox AWS, captured from the real Control UI. The account and prompt are synthetic. I opened the saved failure for the same Gateway chat request on each build. Annotated comparisonMain: the reply asks for another sign-in. Fix: the reply names both account types and the next step. Clean comparison |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
|
Codex review: passed. What this changesThis PR explains incompatible account and model-route requirements through the existing live and saved chat failure notices. Example: An OpenAI subscription account is required for a run using the openai-responses API-key route.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness✅ Ready for maintainer review This PR repairs a confirmed chat diagnostic gap without exposing account identifiers or discarding sanitized provider details; no actionable defects were found. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe route-auth selector supplies diagnostic and sender-safe failure text; runtime preparation and fallback carry it to Gateway projections for live events and saved chat failures. flowchart LR
A[Account and model route] --> B[Route auth selector]
B --> C[Runtime auth preparation]
C --> D[Failover error]
D --> E[Reply failure owner]
E --> F[Gateway projections]
F --> G[Live and saved chat notices]
Technical reviewBest possible solution: Land the focused chat repair after existing current-head gates pass, keeping automation remediation in #208731. Do we have a high-confidence way to reproduce the issue? Current-main source confirms that required-profile mismatches lack sender-safe guidance, and inspected browser captures corroborate the misleading sign-in result; no target code was executed during this review. Is this the best way to solve the issue? The change uses the existing selector, FailoverError, reply owner, and Gateway projections to preserve the privacy boundary while correcting the explanation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 5df0dd1873be. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +61, Tests +104. Total +165 across 13 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall readiness starts with the lower of the proof and patch scores. It is capped at 3/6 if the fix is partial, the change offers little benefit, a product decision is still open, or the PR reverses an earlier decision without saying why. ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)Reviewed November 30, 2026, 1:34 AM ET / 06:34 UTC (Revision 5). |
Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 56adfc8f-688a-4242-ab78-451081503b76
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Keep saved chat account pins as retry preferences. When the sole eligible profile for selection is identity-only, report that it cannot run models. Project the sender-facing failure title into public terminal events instead of the private diagnostic. Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 083cf0f5-62a0-47c6-a916-b39cc00ca81e
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Distinguish provider-formatted notices from account diagnostics when publishing lifecycle failures. Keep sanitized provider facts and previews available to chat clients, scrub private previews for host notices, and preserve the existing policy-stop redaction.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…eeds another account type openclaw#208739 gave route/account mismatches profile-free requester text, but buildFailoverRemediationHint still appends "Re-authenticate with: openclaw models auth login …" to every provider-attributed auth failure. Exhausted fallback summaries and automation run errors therefore still carried sign-in advice, and the failure-repair brief passed it to the owner agent, which asked the user to reconnect a working account. prepare-auth now throws selector-explained mismatches with code model_route_auth_incompatible, and the remediation hint skips that code as it already skips selected_auth_profile_unavailable. The exhausted-fallback error inherits the last attempt's code and builds its hint from the last error, so automations keep the diagnostic without the re-auth hint. Real sign-in failures keep it. Verification: new failover-error test (no hint for the code; a rejected credential keeps it) and code assertions on the openclaw#208739 prepare-auth cases fail on main and pass here; runtime-plan, provider-model-route-auth, model-auth-availability, failover-error, model-fallback and server-chat native-provider-error suites pass. Related: openclaw#208709 (builds on openclaw#208739) Model: claude-opus-5-5 (reasoning effort not exposed to the session) Co-Authored-By: Claude Opus 5.5 <[email protected]>














Related: #208709
This PR changes the interactive chat reply only. The automation repair brief is covered separately by @brandon-julio-t in #208731.
What Problem This Solves
A run tied to a subscription account can select a model route that requires an API key. The run stops before inference, but the reply tells the sender to sign in again. Signing in to the same account cannot make it an API key.
Thanks @brandon-julio-t for reporting the required-account case and @daniel-lxs for the reproduction and fix work.
Work sessions
Linked for team reference; these sessions aren’t public.
User Impact
The reply names what the route accepts and what the run requires, then suggests changing the route or account. It does not identify the account. An identity-only sign-in gets a shorter message: “This account can't run models. Choose another account.” Neither route accepts that account, so the reply does not suggest switching routes. Chat clients still receive the sanitized provider details, including HTTP status and error code, when a provider plugin supplies its own error message. This does not change which accounts can run a model, or how rejected credentials are handled.
Why This Change Was Made
I checked #197737 and #206797. The former distinguished the credential’s inference contract from its storage type. The latter deliberately kept the required profile ID out of chat. The route selector now supplies separate sender-safe text based on that contract. The original profile-specific diagnostic stays available to operators; auth preparation forwards only the sender-safe text through the existing failover path. Route selection and fallback classification are unchanged.
Evidence
Main vs fix: real Control UI screenshots and terminal WebSocket results
I tested main
531c79714e61againstd124152f5ca7on CrabBox AWS. Its tree is identical to tested commitb143ae973b21. All three runs started from Chromium’s Try again button on an isolated Gateway. I matched each browser request to its terminal frame, then verified the title and expanded detail after reloading that run.Saved identity-only account: I saved the session selection through the Gateway on both an API-key route and a subscription route. Main returned “No route-compatible authentication source is configured for openai.” On the fix, both routes said “This account can't run models. Choose another account.” The live frame matched the visible notice.
Bound subscription on an API-key route: On main, the visible error asked for a new sign-in, and the corresponding browser frame contained the synthetic profile ID. On the fix, both said the route requires an API key but the run requires a subscription account. The complete terminal chat frame contained no profile ID.
The saved pin stays a retry preference; it is not promoted to a requirement. The private diagnostic is preserved for operators. The separate composer availability warning is unchanged. The accounts and prior interruption were synthetic; the tested retry and failure were real. No live inference or automation owner repair was exercised.
All 113 focused tests across six files passed on the fix, as did the production build, core typecheck and scoped lint. The saved-selection and live-error regressions failed on the prior PR head.
On
57cf95016, three Chromium retries on an isolated Gateway confirmed that the terminal chat event, saved error, and expanded notice agree for both identity-only routes and the bound subscription. None of the three complete terminal frames contained the profile ID.A local Responses endpoint accepted a working key and returned HTTP 401 for a rejected key. The rejected key kept its sign-in guidance. A saved account preference rotated to a compatible key and completed the turn. A provider plugin with its own 401 wording retained the provider, model, error code, and HTTP status in the terminal chat event. The focused suite passed all 208 tests, along with the Gateway build, core typecheck, scoped lint, and formatting.
Worked on by
🦞 Made with OpenClaw