-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Codex OAuth refresh failures can wedge an agent for hours without clear alerting or aggressive profile rotation #86215
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
When Codex OAuth refresh starts timing out or a profile later returns
401 Unauthorized: Your authentication token has been invalidated, OpenClaw can keep retrying inside the same provider/auth lane for hours without surfacing a clear operator-visible incident and without rotating aggressively enough across other valid profiles.Observed behavior
On my local OpenClaw runtime, Dev was effectively down for about a day even though some Codex subscriptions were still valid. The system did retry and sometimes fell back from
openai/gpt-5.5toopenai/gpt-5.4, but that was still inside the same Codex auth path and did not resolve the incident.What it did wrong:
401 invalidatedon one profile after the prolonged timeout loopExpected behavior
After repeated refresh timeouts or an invalidated-token response, OpenClaw should:
Concrete evidence
From
~/.openclaw/logs/gateway.err.log:2026-05-23T12:42:10.723-07:00embedded run failover decision ... rawError=auth refresh request timed out after 10s2026-05-23T12:43:19.371-07:00Embedded agent failed before reply: All models failed (2): openai/gpt-5.5: auth refresh request timed out after 10s (timeout) | openai/gpt-5.4: auth refresh request timed out after 10s (timeout)2026-05-24T13:27:55.170-07:002026-05-24T14:28:22.074-07:00embedded run failover decision ... reason=auth ... rawError=unexpected status 401 Unauthorized: Your authentication token has been invalidated. Please try signing in again.Current runtime state after restart/reauth showed multiple configured
openai-codexOAuth profiles, including both Pro and Free accounts, but the outage path was not surfaced as a clear profile-selection/auth incident.Environment
2026.5.22Why this matters
This failure mode makes the system look like the model or subscription is just "down" while the actual problem is auth refresh/profile management. The current behavior costs hours of silent degraded service and forces manual log spelunking to understand what happened.
Suggested fix areas