Repository navigation
Desktop: propagate account/token changes to active threads and retry stale-auth limit failures #32173
Description
What variant of Codex are you using?
Codex App (macOS)
What feature would you like to see?
When account or token A reaches its usage limit, I explicitly switch Codex to account or token B, which still has quota. Threads that were already running remain bound to A. They may continue for a while, but as each thread makes another model request it eventually fails on A's usage limit. I then have to open every affected thread, type continue, and submit it manually; that new turn finally uses B.
This is especially disruptive with several long-running threads. The global account/token switch appears successful, but it does not propagate to the in-memory authentication state of active threads.
This request is not for automatic multi-account rotation. It is about honoring an explicit user-initiated account/token change everywhere in the running app.
Expected behavior
- An explicit account/token change should invalidate and refresh authentication for all active thread/app-server workers.
- Any model request started after the switch should use the newly active credential.
- If a turn fails only because it used a superseded credential, Codex should rebind and retry or resume it once automatically, without requiring a manual
continue. - The retry should resume from a safe interruption boundary and must not replay already-completed tool side effects.
- The UI should show which account/token a thread is using, or clearly report when a thread could not be rebound.
Additional information
Steps to reproduce
- Sign in with account/token A.
- Start several long-running threads concurrently.
- Let A reach its usage/rate limit.
- While those threads are still active, explicitly switch or sign in to account/token B with available quota.
- Observe that existing threads continue using A and later stop with A's usage-limit error.
- Open an affected thread and send
continue. - Observe that the thread resumes using B.
The screenshot below shows one task stopping at the usage limit and resuming only after I manually send continue.
Related issues
- Codex Desktop App uses credits from the original account even after switching to a different Plus account #21314 — existing Desktop/SSH threads remain pinned to the original account
- Desktop: hard quit required after account switching to recover hidden threads, turn/start, and slow thread resume #27601 — Desktop live auth/thread state is not fully refreshed after account switching
- [BUG] Switching accounts and making a prompt makes it warn about the previous' account usage limit, stops and wastes usage #16894 — the previous account's usage limit still blocks the IDE extension after switching
- Allow re-authentication or API key entry after reaching plan limits #3366 — re-authenticate and continue a single CLI session after hitting plan limits
- Feature Request: Auto-resume CLI session when usage limit resets #21073 — auto-resume after a usage-limit reset
Distinct scope: propagate an explicit credential change across all concurrently active Desktop threads, plus a safe one-time retry for turns interrupted by stale authentication.

Activity
briancl2 commentedon Aug 6, 2026
Adding direct managed-ChatGPT-auth evidence from a sanitized investigation: https://github.com/briancl2/build-meta-analysis/issues/1559#issuecomment-5207186363
During active delegated work, refresh-token failure produced terminal
task_completeevents classifiedunauthorizedwith no final agent message. A new turn in the persisted task failed again, and a fresh replacement failed before tools. The stored thread, GitHub issue/PR, branch, worktree, and artifact state all survived. After ordinary app re-auth, new turns/tasks worked.This supports the requested propagation/rebind behavior and adds one important distinction: current documented thread read/resume plus a new turn preserved work, but no exact failed-turn auto-resume contract was found. A safe repair needs a paused-for-auth state or idempotent resume/rebind boundary that cannot replay completed tool effects.
Claim ceiling: one bounded macOS Desktop auth-expiry episode; no account-switch, all-host, or product-fix claim.
karolzlot commentedon Sep 7, 2026
Reproduced a related app-server bug with stock Codex CLI
0.147.0and0.153.4, using a local mock provider and synthetic credentials: complete a WebSocket turn on account A, leave the thread idle, awaitaccount/login/startwithchatgptAuthTokensfor B, confirm B throughaccount/read, then start another turn on the same thread. The next request still uses the WebSocket authenticated as A.Two controls distinguish this from a login-ordering problem: HTTP requests correctly use B, and when the preceding WebSocket turn ends with
usage_limit_reached, Codex discards that connection and the next turn after switching opens a new socket authenticated as B.In
0.153.4, the WebSocket reuse check does not compare the connection’s authenticated identity with the newly applied auth. This provides a concrete transport-level mechanism for stale-account requests after successful login; Desktop’s account-switch propagation was not exercised. Further findings: happier-dev/happier#350.