fix(auth): show claude-cli reauth hint for expired OAuth#97561
fix(auth): show claude-cli reauth hint for expired OAuth#97561lin-hongkuan wants to merge 2 commits into
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 28, 2026, 5:51 PM ET / 21:51 UTC. Summary PR surface: Source +21, Tests +38. Total +59 across 4 files. Reproducibility: yes. at source level: current main routes the reported typed Claude CLI 401 auth failure through generic provider-auth handling before OAuth reauth guidance, and the current OAuth matcher does not recognize the reported Claude CLI text. I did not run a live expired-token Claude CLI session. Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the focused classifier and reply-precedence fix after redacted real expired-token Claude CLI proof shows the channel-visible recovery command matches the documented Anthropic CLI auth flow. Do we have a high-confidence way to reproduce the issue? Yes, at source level: current main routes the reported typed Claude CLI 401 auth failure through generic provider-auth handling before OAuth reauth guidance, and the current OAuth matcher does not recognize the reported Claude CLI text. I did not run a live expired-token Claude CLI session. Is this the best way to solve the issue? Yes for the code shape: the shared OAuth classifier plus reply-precedence change is the narrow owner-boundary fix, and the follow-up commit corrected the command to the documented Anthropic CLI auth route. It is not merge-clear until real behavior proof is added. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8f31b3218f9d. Label changesLabel justifications:
Evidence reviewedPR surface: Source +21, Tests +38. Total +59 across 4 files. View PR surface stats
Acceptance criteria:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
@clawsweeper re-review Pushed a narrow follow-up commit fixing the re-auth command contract for Claude CLI OAuth expiry. Commit: What changed:
Validation on the PR branch:
I did not fabricate live Telegram/Claude proof; this update addresses the actionable command-correctness issue and provides deterministic local regression evidence. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
Related: #97553
What Problem This Solves
Fixes an issue where users running the Claude CLI OAuth route could see a generic provider authentication failure after the OAuth token expired, instead of an actionable OpenClaw re-authentication hint.
Why This Change Was Made
This recognizes the Claude CLI expired-OAuth 401 shape as a gateway login refresh failure and lets that specialized handling run before the generic provider-authentication copy. The matcher is intentionally narrow to
claude-cliplus the observed 401 invalid-credentials message so unrelated 401 failures keep the existing generic handling.User Impact
Users now get the exact recovery command for the affected route:
openclaw models auth login --provider claude-cliinstead of a generic “re-authenticate this provider” message.
Evidence
node scripts/run-vitest.mjs src/agents/auth-profiles/oauth-refresh-failure.test.ts src/auto-reply/reply/agent-runner-execution.test.tssrc/agents/auth-profiles/oauth-refresh-failure.test.ts: 3 tests passedsrc/auto-reply/reply/agent-runner-execution.test.ts: 216 tests passedgit diff --checkThis PR is AI-assisted.