Repository navigation
fix(cli): surface model auth refresh failures - #131968
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 8, 2026, 11:58 PM ET / September 9, 2026, 03:58 UTC (Revision 8). ClawSweeper reviewWhat this changesMakes model-auth commands distinguish saved credentials from failed Gateway refreshes, give host-specific recovery guidance, and refresh committed credential purges before replacement login. Merge readiness⛔ Blocked before merge - 4 items remain This PR remains useful: current main still suppresses refresh failures, and the related merged auth-order fix does not replace it. No blocking code defect was found. The posted owner-review exception still needs verification under repository policy. Priority: P1 Review scores
Verification
How this fits togetherModel-auth commands save credentials locally and ask the running Gateway to refresh its prepared authentication state. The Gateway publishes that state for subsequent requests and returns refresh outcomes to the CLI. flowchart TD
A[Model auth command] --> B[Save local credentials]
B --> C[Classify Gateway target]
C --> D[Local authenticated refresh]
C --> E[Remote host guidance]
D --> F[Prepare authentication state]
F --> G[Publish refreshed state]
F --> H[Report refresh failure]
Decision needed
Why: Repository policy requires listed-owner involvement or verified organization-owner direction; the comment alone does not establish either. Before merge
Agent review detailsSecurityNone. PR surfaceSource +37, Tests +203. Total +240 across 14 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain successful local credential writes and truthful refresh outcomes, with owner acceptance of the explicit-refresh failure contract before landing. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main catches both CLI refresh rejection and Gateway preparation failures, allowing persisted changes to appear fully applied. This review did not execute target code. Is this the best way to solve the issue? Yes. The repair uses the existing shared refresh owner and explicit refresh request, preserves ordinary reads and generation retry, and needs no parallel API or new configuration mode. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b72b30249fd0. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (7 earlier review cycles)
|
1b5ede9 to
7f68369
Compare
7f68369 to
a3f476e
Compare
34dbced to
2330d5f
Compare
|
landpr-approve-admin-merge |
Keep local model-auth writes usable while the Gateway is offline, report connected refresh failures with host-specific recovery, and refresh a committed force purge before replacement login. Propagate explicit Gateway auth preparation failures while preserving ordinary reads and generation safety. Reuse the existing connected auth-refresh suite for failure coverage and retain current credential persistence when resolving the required test conflict. All original contributor commits are preserved. Validation: exact-head CI 34306787889 passed, including all four connected Gateway cases. Fresh independent compiled CLI acceptance passed offline persistence, connected rejection, remote/URL guidance, invalid-method preservation and purge-before-cancellation behavior. The scoped owner-review exception is recorded at openclaw#131968 (comment). Co-authored-by: Ayaan Zaidi <[email protected]>
|
Thanks @vyctorbrzezowski! Proof: Exact-head CI and fresh independent compiled CLI acceptance passed. The connected Gateway suite passed its failure, admitted-run, waiter and rejection cases. Fresh local ClawSweeper review passed before guarded landing.
The compiled acceptance uses synthetic credentials and an authenticated Gateway error fixture; it does not claim live provider login or inference. The authorized owner-review exception waived the procedural owner wait; correctness, security, proof and required CI gates remained in force. |
What Problem This Solves
CLI model-auth changes could leave a running Gateway using stale credentials while the command appeared successful. Connected refresh failures were hidden, a forced re-login did not publish its committed purge when replacement login failed, and remote clients received recovery instructions for the wrong host.
Closes #131944
Why This Change Was Made
The shared CLI refresh helper distinguishes local and remote targets, preserves silent auth-refresh handling when no local Gateway listens, and reports a saved change separately from a failed runtime refresh. Remote and tunnel targets receive guidance for the Gateway host.
A forced re-login validates the provider and method, commits the purge, and attempts refresh before replacement login. Explicit Gateway auth-refresh preparation failures return
UNAVAILABLE. Ordinary last-good reads and owner-generation retry behavior remain intact.The connected failure regression shares the existing Gateway auth-refresh dispatch suite. This removes the extra test root that broke the unchanged CI boundary limit while retaining the faulting reader, exact read count, response code and error message. The three existing generation and admitted-run cases remain in that suite.
The required merge conflict retains the current credential-persistence owner and the refresh warning assertion. All five commits from @vyctorbrzezowski are preserved. No configuration option, database schema or protocol version is added.
User Impact
Evidence
c7fbc2283c4f34f060ef08d09acb74ca00b315d1, including the required aggregate gate, typechecks, lint and additional-boundary check.UNAVAILABLEafter an injected auth-store failure. The CLI force-login and prepared-auth error/supersession siblings also passed in this run.be2ccb6a0fdd4959cabb23365d40fa5b7027b135; its full source tree matches the PR head. The original build stamp is retained.2330d5f8f9670de79fdba3ce05f143db154d7a97.Two native source-mode attempts timed out before producing a test result; neither is counted as a pass. CI supplied the missing connected-suite coverage. Compiled-fixture setup failures were retained and corrected at their observed status-preflight and terminal-size boundaries. Completed proof was reused.
Scope and Limits
The compiled CLI acceptance uses bundled OpenRouter and synthetic isolated state with an authenticated Gateway error fixture. It does not claim live provider authentication or inference. Gateway failure, ordinary-read and generation behavior are covered separately by the actual connected Gateway CI suite and source review. The independent report retains the absence of a separate auth-order read and raw fixture-response/configuration exports.
The CLI can also emit an existing installed-service discovery warning in the isolated environment. That warning is distinct from auth-refresh failure and was not hidden or treated as a failed credential save.
The authorized procedural owner-review exception is recorded for this exact head. Correctness, security, proof and required CI gates remain in force.
Production: +55/-18, net +37. Tests: +241/-38, net +203. The production growth owns shared target classification and actionable failure output; the redundant connected-server fixture was removed.