Desktop: propagate account/token changes to active threads and retry stale-auth limit failures
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
- #21314 — existing Desktop/SSH threads remain pinned to the original account
- #27601 — Desktop live auth/thread state is not fully refreshed after account switching
- #16894 — the previous account's usage limit still blocks the IDE extension after switching
- #3366 — re-authenticate and continue a single CLI session after hitting plan limits
- #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.
<img width="802" height="727" alt="Image" src="https://github.com/user-attachments/assets/29ef2444-7940-4173-9076-13b40e7aef1e" />