[Bug]: Switching Codex subscriptions causes active-writer error and context loss after restart #10414
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/server
Steps to reproduce#
Setup: Multiple Codex provider instances using separate authentication through shadow homes, with shared sessions and state_5.sqlite via symlinks.
- Start a conversation using Codex subscription A and build up conversation history.
- After A reaches its usage limit, select subscription B in the same T3 conversation.
- Send another message.
- Observe “ProviderAdapterProcessError: ... thread already has an active writer”.
- Quit T3 completely and reopen it.
- Continue the same conversation using subscription B.
- The previous messages remain visible, but the assistant no longer remembers the conversation.
This has happened repeatedly for several weeks.
Expected behavior#
Switching between compatible Codex subscriptions should preserve conversation context. If switching fails, restarting T3 and retrying should resume the original Codex conversation rather than silently create a fresh one.
Actual behavior#
Switching subscriptions fails with an active-writer error. Restarting T3 allows me to send messages again, but the assistant loses the previous context while the existing chat history remains visible.
A read-only investigation found 41 active-writer failures across 9 conversations since August 8, 2026. In a September 5 occurrence, a failed subscription switch was followed by a new Codex thread ID with zero previous turns inside the same T3 conversation.
Impact#
Blocks work completely
Version or commit#
T3 Code Alpha 0.0.38, commit c0995d2eaf8e
Environment#
macOS; T3 desktop app; Codex CLI 0.153.4; GPT-6-Astra; multiple Codex subscription instances using shadow homes with shared session storage.
Logs or stack traces#
ProviderAdapterProcessError: Provider adapter process error (codex) for thread <t3-thread-id>: thread <codex-thread-id> already has an active writer
Read-only diagnostic findings:
- lsof confirmed that the old subscription's Codex process, launched by T3, still held the exact conversation writer lock blocking the new subscription.
- The persisted runtime binding referenced subscription A, while the UI session state referenced subscription B with an error.
- Installed bundle inspection found that ProviderService.startSession calls adapter.startSession BEFORE stopStaleSessionsForThread.
- The persisted resume cursor is reused only when the saved providerInstanceId matches the requested instance. After restarting following a failed switch, these can differ.
These are process/history observations and source-inspection findings, not results from a tested patch.
Related PR: https://github.com/pingdotgg/t3code/pull/7414
This report also covers context loss after restarting following a failed subscription switch.
Screenshots, recordings, or supporting files#
Screenshot 2026-09-07 at 12.50.27 AM.png Screenshot 2026-09-07 at 12.50.43 AM.png
Workaround#
Quitting and reopening T3 clears the immediate error, but conversation context is lost afterward. I have not found a workaround that reliably preserves continuity.
farzinnasiri(GitHub profile, opens in a new tab) added labelsbug
farzinnasiri(GitHub profile, opens in a new tab) added labelsneeds-triage
juliusmarminge removed labelsneeds-triage
juliusmarminge added labelsduplicate
juliusmarminge closed this
Sign in to join this conversation.
Duplicate of #8259 — same Codex active-writer failure when switching provider/subscription instances in an existing thread (including the
startSessionbeforestopStaleSessionsForThreadhandoff). The post-restart context-loss detail belongs on that issue; please continue discussion there.