Repository navigation
fix: recover Claude native login without Gateway restart - #172471
Conversation
|
ClawSweeper reviews are opt-in for maintainers. If a review is required, finish the work and validation first, then comment |
|
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR refreshes unavailable native Claude login before spawn admission and lets Claude handle authentication when status probes are inconclusive. Example: A Gateway captures missing Claude login, then the user signs in again.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR fixes a demonstrated native Claude spawn failure that remains on current main, with no actionable defects found. Priority: P1 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Anthropic plugin observes Claude CLI login, the prepared catalog owns published availability, and model-choice admission consumes those facts before dispatching execution to Claude. flowchart LR
A[Spawn request] --> B[Model choice admission]
B --> C[Prepared catalog owner]
C --> D[Anthropic login discovery]
D --> E[Claude auth status]
E --> C
C --> B
B --> F[Claude CLI execution]
Technical reviewBest possible solution: Land the recovery through the existing catalog owner while retaining Claude’s native authentication and selected-account boundaries. Do we have a high-confidence way to reproduce the issue? The supplied real-Gateway comparison demonstrates the failure, and current main retains the same responsible code; this read-only review executed no target code. Is this the best way to solve the issue? The patch repairs stale admission facts at their existing owner, preserves route identity, and distinguishes confirmed logout from an inconclusive observation without introducing another authentication owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eaa6938874c3. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +31, Tests +99, Docs +1. Total +131 across 16 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel 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 follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed October 14, 2026, 5:33 PM ET / 21:33 UTC (Revision 3). |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Redacted execution evidence for the base and final candidate. These are selected fields from the saved The missing → real transition did not restart the Gateway. The timeout case used a 12-second sleep before delegating to the real status command. Both successful candidate children completed a real turn with {
"base": {
"head": "46ed68fb425dcee69647e8a5d32c4a22259a54c7",
"context": "gui/501 (Aqua)",
"healthy": {
"spawnStatus": "accepted",
"waitStatus": "ok",
"terminalReply": "OK"
},
"missing-initial": {
"spawnStatus": "error",
"message": "The selected account or native runtime is unavailable for [model]. Restore that account before spawning this model."
},
"recovered-immediate": {
"spawnStatus": "error",
"message": "The selected account or native runtime is unavailable for [model]. Restore that account before spawning this model."
},
"recovered-expired": {
"spawnStatus": "error",
"message": "The selected account or native runtime is unavailable for [model]. Restore that account before spawning this model."
},
"probeLog": [
"2026-10-14T20:34:14Z missing",
"2026-10-14T20:34:14Z missing",
"2026-10-14T20:34:15Z missing"
]
},
"candidate": {
"head": "a2326dac1d663e892640ff30a202acd2bac00307",
"context": "gui/501 (Aqua)",
"missing-initial": {
"spawnStatus": "error",
"message": "The selected account or native runtime is unavailable for [model]. Restore that account before spawning this model."
},
"recovered-next": {
"spawnStatus": "accepted",
"waitStatus": "ok",
"terminalReply": "OK"
},
"timeout": {
"spawnStatus": "accepted",
"waitStatus": "ok",
"terminalReply": "OK"
},
"probeLog": [
"2026-10-14T20:52:41Z missing",
"2026-10-14T20:52:41Z missing",
"2026-10-14T20:52:41Z missing",
"2026-10-14T20:52:42Z real",
"2026-10-14T20:52:43Z real",
"2026-10-14T20:53:57Z timeout",
"2026-10-14T20:54:07Z timeout",
"2026-10-14T20:54:18Z timeout"
]
}
} |
|
@clawsweeper review |
|
🦞👀 Re-review progress:
|
|
Landed in 6f53333. Native Claude login recovery now rechecks the existing auth owner before spawn admission; explicit logout still blocks, and inconclusive probes defer authentication to Claude. The isolated gui/501 comparison covers missing → recovery without restart and a 12-second timeout, including real Claude replies. Exact-head CI is green and ClawSweeper is ready. Redacted execution evidence: #172471 (comment). Thanks to everyone who reported and helped narrow this recovery failure. |
…2471) ## What Problem This Solves Fixes native Claude spawns staying blocked after a failed login capture even when the user signs in again, without restarting the Gateway. A timeout or malformed auth-status response also incorrectly counted as a logout. ## User Impact The next spawn after login recovery rechecks authentication and can run immediately. Only an explicit `loggedIn: false` from `claude auth status --json` blocks the native route; timeout, command failure, and malformed responses remain inconclusive and let Claude try the request. Claude still owns login and token refresh. No token storage is read or copied. There are no UI, setup-flow, metadata-observer, or native-status transport changes. ## Why This Change Was Made The existing provider-discovery capture now expires after 60 seconds. Admission awaits the existing native-login recheck and rematerializes its auth fact. The CLI-runtime evaluator retains native-route provenance even when authentication is missing, so both direct CLI selections and provider aliases reach that recheck. ## Evidence The base and candidate ran as isolated `gui/501` LaunchAgents with the login Keychain. A PATH shim intercepted only `claude auth status`; all inference calls used the real Claude executable. - **Base `5c5b6e9020cd`:** a real child first replied `OK`. After explicit missing-login injection, restoring the real status command without a restart left both the immediate and 65-second-later spawn refused. No fresh status probe occurred (`gui-base-shim/`: `healthy.json`, `missing-initial.json`, `recovered-immediate.json`, `recovered-expired.json`, `probes.log`). - **Candidate `a2326dac1d66`:** explicit missing login refused the spawn with the existing “Restore that account before spawning this model” message. Switching to real status without a restart caused the next spawn to re-probe, be admitted, and complete a real Claude turn with `OK`. A status shim sleeping 12 seconds also admitted the spawn as inconclusive, and the real child replied `OK` (`gui-candidate-final/`: `summary.json`, `missing-initial.json`, `recovered-next.json`, `timeout.json`, `probes.log`). Both probe contexts reported `Aqua`; the isolated profile was torn down. Redacted [Gateway responses, completed turns, and probe logs](openclaw#172471 (comment)) are available for inspection. - Earlier SSH-session observations were invalid for this defect because that background session had a different Keychain search list. - 105 focused tests passed across model-runtime-choice, native-choice, model-auth-availability, provider-discovery, and CLI auth status. One candidate build passed. - Final head `4515d276fcbb` only adds explicit ignored-promise/undefined syntax and aligns existing plugin and model-list tests with the native-auth policy and route identity. It preserves the GUI-tested execution behavior. Its 55 focused tests and type-aware lint passed; the bounded candidate review found no actionable defects. - Against the PR base: production **+59/-28 (net +31)**; tests **+110/-11 (net +99)**; docs **+6/-5 (net +1)**. The superseded broader implementation and dependent draft are no longer in scope. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
Fixes native Claude spawns staying blocked after a failed login capture even when the user signs in again, without restarting the Gateway. A timeout or malformed auth-status response also incorrectly counted as a logout.
User Impact
The next spawn after login recovery rechecks authentication and can run immediately. Only an explicit
loggedIn: falsefromclaude auth status --jsonblocks the native route; timeout, command failure, and malformed responses remain inconclusive and let Claude try the request.Claude still owns login and token refresh. No token storage is read or copied. There are no UI, setup-flow, metadata-observer, or native-status transport changes.
Why This Change Was Made
The existing provider-discovery capture now expires after 60 seconds. Admission awaits the existing native-login recheck and rematerializes its auth fact. The CLI-runtime evaluator retains native-route provenance even when authentication is missing, so both direct CLI selections and provider aliases reach that recheck.
Evidence
The base and candidate ran as isolated
gui/501LaunchAgents with the login Keychain. A PATH shim intercepted onlyclaude auth status; all inference calls used the real Claude executable.46ed68fb425d: a real child first repliedOK. After explicit missing-login injection, restoring the real status command without a restart left both the immediate and 65-second-later spawn refused. No fresh status probe occurred (gui-base-shim/:healthy.json,missing-initial.json,recovered-immediate.json,recovered-expired.json,probes.log).a2326dac1d66: explicit missing login refused the spawn with the existing “Restore that account before spawning this model” message. Switching to real status without a restart caused the next spawn to re-probe, be admitted, and complete a real Claude turn withOK. A status shim sleeping 12 seconds also admitted the spawn as inconclusive, and the real child repliedOK(gui-candidate-final/:summary.json,missing-initial.json,recovered-next.json,timeout.json,probes.log). Both probe contexts reportedAqua; the isolated profile was torn down.Redacted Gateway responses, completed turns, and probe logs are available for inspection.
4515d276fcbbonly adds explicit ignored-promise/undefined syntax and aligns existing plugin and model-list tests with the native-auth policy and route identity. It preserves the GUI-tested execution behavior. Its 55 focused tests and type-aware lint passed; the bounded candidate review found no actionable defects.