Fix/codex deactivated workspace failover#55893
Conversation
Greptile SummaryThis PR adds
The change is narrowly scoped to error-string classification and does not touch fallback ordering, cooldown policy, auth storage, or any network behaviour. Confidence Score: 5/5Safe to merge — change is a single-line regex addition with full unit-test coverage and no side effects on other classification paths. The fix is minimal, correctly placed, and well-tested. All existing patterns and tests are unaffected. No P0 or P1 issues found. No files require special attention.
|
| Filename | Overview |
|---|---|
| src/agents/pi-embedded-helpers/failover-matches.ts | Adds /deactivated[_ ]workspace/i regex to authPermanent pattern list — minimal, correct, and consistent with existing patterns. |
| src/agents/failover-error.test.ts | Adds a targeted test asserting deactivated_workspace resolves to auth_permanent at the failover-reason level. |
| src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts | Adds deactivated_workspace to the isAuthPermanentErrorMessage positive samples and a classifyFailoverReason assertion. |
Reviews (1): Last reviewed commit: "Merge branch 'main' of ssh://ssh.github...." | Re-trigger Greptile
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. source-reproducible: on current main, a PR rating 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. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land this narrow classifier mitigation with the refreshed current-head proof, while leaving active workspace selection and recovery behavior to #56693. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: on current main, a Is this the best way to solve the issue? Yes for the mitigation: adding a narrow marker plus nested Label changes:
Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 1d5b5db4d221. |
458519d to
27c56e8
Compare
|
ClawSweeper PR egg ✨ Hatched: 🌱 uncommon Moonlit Review Wisp Hatch commandComment Hatchability rules:
Rarity: 🌱 uncommon. What is this egg doing here?
|
27c56e8 to
d89c874
Compare
d89c874 to
3aa770f
Compare
|
@clawsweeper re-review |
|
🦞🧹 Reason: re-review requires an open issue or PR. |
|
@clawsweeper re-review |
|
Merged via squash.
Thanks @litang9! |
Summary
deactivated_workspacewas not classified as a failover-eligible permanent auth condition, so OpenClaw could stop on an unclassified provider failure instead of entering the existing fallback path.deactivated[_ ]workspacematcher toHIGH_CONFIDENCE_AUTH_PERMANENT_PATTERNSand covered it at helper and failover-reason boundaries.Change Type
Root Cause / Regression History
The Codex provider can return
{"detail":{"code":"deactivated_workspace"}}for a deactivated workspace, but the failover classifier only recognized revoked/deactivated API keys, disabled/revoked keys, deactivated accounts, and organization blocks. The missing marker meantresolveFailoverReasonFromError(...)could return no permanent-auth reason for this provider state.Regression Test Plan
src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts:deactivated_workspaceanddeactivated workspacematch permanent auth.src/agents/failover-error.test.ts: the same markers resolve toauth_permanentthroughresolveFailoverReasonFromError(...).User-visible / Behavior Changes
Provider errors containing
deactivated_workspaceare treated as a permanent auth/failover condition instead of an unknown classification.Security Impact
Real behavior proof
openai-codex/gpt-5.4andopenai-codex/gpt-5.3-codexhit a real upstream Codex response{"detail":{"code":"deactivated_workspace"}}; before this patch, that marker was not in the permanent-auth matcher set.provider=openai-codex,model=gpt-5.4/gpt-5.3-codex, redacted to omit run/session IDs. After-fix verification ran on this PR head27c56e8192from currentupstream/main4505a88d88.node --import tsx -e "const { resolveFailoverReasonFromError, coerceToFailoverError } = await import('./src/agents/failover-error.ts'); const samples = ['deactivated_workspace', 'deactivated workspace', '{\"detail\":{\"code\":\"deactivated_workspace\"}}']; for (const message of samples) console.log(JSON.stringify({ message, reason: resolveFailoverReasonFromError({ message }), coercedReason: coerceToFailoverError({ message }, { provider: 'openai-codex', model: 'gpt-5.4' })?.reason }));" ./node_modules/.bin/vitest run src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts src/agents/failover-error.test.tsRedacted real pre-fix OpenClaw runtime samples:
auth_permanentthrough the same failover classification/coercion boundary used before model fallback handling.Verification
./node_modules/.bin/vitest run src/agents/pi-embedded-helpers.isbillingerrormessage.test.ts src/agents/failover-error.test.tsCompatibility / Migration
Risks and Mitigations
deactivated_workspaceis provider-specific and is mapped into the existingauth_permanentbucket.deactivated[_ ]workspace) and only changes classification for this marker.Current-head maintainer proof after rebase
3aa770fa848bf3a9701484d4aa23bcdbeb508a79origin/main1d5b5db4d221b6d6b81d40c0c05cc644796d5b3bcloudflare, leasecbx_5b879c7b4630.pnpm install --frozen-lockfile, thennode --import tsximportedsrc/agents/failover-error.tsand exercised the failover classification/coercion boundary.Current-head output:
Current-head CI/proof status:
Real behavior proofpassed for the rebased PR head and reported:External PR includes after-fix real behavior proof.