You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[CLI][TUI] Session resume can fail with 'already has an active writer' after approval-mode use or session switching #39823
Resuming an existing Codex CLI/TUI session can fail with an already has an active writer error, even when I expect the session to be available for continuation.
I have observed this after previously using --not-so-yolo / --approve-for-me, as well as after switching between sessions in the TUI. I am not claiming those modes are necessarily the root cause, only that they are contexts in which the failure has occurred.
The error looks like:
Error: Failed to resume session from .../rollout-...jsonl:
thread/resume failed during TUI bootstrap:
thread/resume failed: thread <THREAD_ID> already has an active writer (code -32600)
This is not Windows-specific. I have reproduced the same resume failure on both Windows and a Linux server.
The session itself still exists, but Codex refuses to resume it because the thread is considered to have an active writer.
What steps can reproduce the bug?
The exact trigger is not fully isolated yet, but I have seen it in these flows:
Start and use an interactive Codex CLI/TUI session.
Use --not-so-yolo / --approve-for-me, or switch between sessions from the TUI.
Later attempt to resume the previous session with codex resume or through the TUI.
Codex fails during TUI bootstrap with thread <THREAD_ID> already has an active writer (code -32600).
What is the expected behavior?
If no other client is actively writing to the thread, Codex should allow the existing session to be resumed normally.
If another writer really is active, Codex should identify the owning process/session clearly enough for the user to understand what is holding the thread and recover safely.
Additional information
The same failure has occurred across more than one environment, so it does not appear to be specific to Windows path handling or the Windows /resume picker.
changed the title [-][CLI][TUI] Resuming session fails with 'already has an active writer' and Windows CWD filter mismatch[/-][+][CLI][TUI] Session resume can fail with 'already has an active writer' after approval-mode use or session switching[/+]on Aug 21, 2026
I can reproduce this consistently on Linux with Codex CLI 0.149.1 using the following sequence:
Start Codex normally.
Trigger a command that requires manual approval.
Press Ctrl+C while the approval prompt is open.
Restart with codex --approve-for-me.
Resume the interrupted session.
Resume fails with:
thread/resume failed during TUI bootstrap:
thread/resume failed: thread THREAD_ID already has an active writer
(code -32600)
Restarting normally without --approve-for-me allows the same session to resume successfully.
Additional Linux reproduction on Codex CLI 0.149.1 (2026-08-25 UTC).
I hit the same failure while trying to resume a saved TUI session:
Failed to resume session from ~/.codex/sessions/.../rollout-...jsonl:
thread/resume failed during TUI bootstrap:
thread/resume failed: thread <THREAD_ID> already has an active writer (code -32600)
The rollout JSONL is intact and ends with a normal task_complete record. The matching lock file is present at ~/.codex/thread-writer-locks/<THREAD_ID>.lock. Read-only inspection showed that a still-running Codex CLI process held the lock and its write descriptor, so this instance is an active-writer lifecycle/handoff case rather than an unowned lock file. The owning process was an older TUI left running while a new TUI attempted the resume.
Expected behavior: show the owning client/process, or provide a safe attach, handoff, or read-only recovery path. A duplicate lock-file deletion workaround would risk two writers.
I reproduced the exact TUI-bootstrap error on Windows during a cross-surface resume after the Desktop app update.
Environment:
OpenAI.Codex Store package 26.825.3734.0 (Arm64)
Standalone codex-cli 0.150.1
Windows 11 Pro, build 28000, ARM64
The affected rollout was created from the VS Code surface and records CLI version 0.142.5
The failure is:
thread/resume failed during TUI bootstrap:
thread/resume failed: thread <redacted> already has an active writer (code -32600)
A read-only sanitized inspection found the rollout present and parseable: one session_meta, 595 turn_context records, 88,715 JSONL records, and zero invalid JSON lines. I did not modify the database or rollout.
A writer may still be live in the other surface. The user-visible problem is that the TUI reports only an opaque conflict. It does not identify the owning process or surface, offer observer mode, or provide a safe handoff action.
I uploaded the affected thread ID and diagnostics privately through /feedback.
Additional user report on codex-cli 0.151.0 under WSL2/Windows Terminal: while editing a prompt, the user instinctively pressed Ctrl-X as the familiar clipboard cut shortcut. The TUI disappeared, and attempting to resume immediately failed with the exact active-writer error reported here.
The usability impact is larger than an obscure key collision: Ctrl-X is a deeply learned clipboard/editing gesture, so binding a lone press to an immediate exit can unexpectedly disrupt a long conversation and make users reasonably fear that their thread has been lost.
Please consider making Ctrl-X non-destructive by default, or requiring a confirmation/second press before exiting. If another writer remains active after an exit, the resume error should identify the owning process or surface and offer a safe attach/handoff/retry path. Configurable keymaps provide a local workaround, but users should not need to discover and remap a common clipboard shortcut after losing access to a session.
Additional macOS reproduction on Codex CLI 0.153.0 (Apple Silicon, running under tmux).
This happened multiple times today while switching/resuming local TUI sessions. In the most recent case:
Start a normal interactive Codex session and complete a turn.
Press Ctrl-C twice in quick succession while exiting/interruption is in progress (habit from other terminal agents).
The pane/session appears to exit.
Try to resume the saved session with codex resume <thread-id>.
Resume fails during TUI bootstrap with:
thread/resume failed during TUI bootstrap:
thread/resume failed: thread <thread-id> already has an active writer (code -32600)
The second Ctrl-C is another SIGINT, not SIGKILL, but it appears to expose a teardown race between the TUI, the Node wrapper, and the native Codex process. Local logs recorded repeated active-writer conflicts for the same thread across several minutes. The rollout remained present and ended with a normal completed turn; no rollout or database repair was needed.
In this incident, stopping the abandoned Codex process/session eventually released the writer, and a clean resume then succeeded. The error did not identify the owning process or provide an attach, handoff, or safe recovery action. A separate thread showed the same error when an older TUI was still alive in another tmux pane, which made it difficult to distinguish “another active owner” from a stranded writer.
Expected behavior:
repeated SIGINT during exit should leave the thread resumable;
if a live owner exists, identify the owning surface/process and offer attach or explicit handoff;
if the owner is gone, recover the writer automatically;
the error should not require users to inspect lsof and manually reason about process lifetimes.
I have intentionally omitted usernames, repository paths, thread IDs, and raw transcripts.
Activity
github-actions commentedon Aug 21, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
[-][CLI][TUI] Resuming session fails with 'already has an active writer' and Windows CWD filter mismatch[/-][+][CLI][TUI] Session resume can fail with 'already has an active writer' after approval-mode use or session switching[/+]Fireotics commentedon Aug 21, 2026
{"detail":"Bad Request"} Error
shallitbeso commentedon Aug 25, 2026
I can reproduce this consistently on Linux with Codex CLI 0.149.1 using the following sequence:
Start Codex normally.
Trigger a command that requires manual approval.
Press Ctrl+C while the approval prompt is open.
Restart with codex --approve-for-me.
Resume the interrupted session.
Resume fails with:
thread/resume failed during TUI bootstrap:
thread/resume failed: thread THREAD_ID already has an active writer
(code -32600)
Restarting normally without --approve-for-me allows the same session to resume successfully.
Skandesh commentedon Aug 25, 2026
Additional Linux reproduction on Codex CLI 0.149.1 (2026-08-25 UTC).
I hit the same failure while trying to resume a saved TUI session:
The rollout JSONL is intact and ends with a normal
task_completerecord. The matching lock file is present at~/.codex/thread-writer-locks/<THREAD_ID>.lock. Read-only inspection showed that a still-running Codex CLI process held the lock and its write descriptor, so this instance is an active-writer lifecycle/handoff case rather than an unowned lock file. The owning process was an older TUI left running while a new TUI attempted the resume.Expected behavior: show the owning client/process, or provide a safe attach, handoff, or read-only recovery path. A duplicate lock-file deletion workaround would risk two writers.
nos1609 commentedon Aug 28, 2026
I reproduced the exact TUI-bootstrap error on Windows during a cross-surface resume after the Desktop app update.
Environment:
26.825.3734.0(Arm64)codex-cli 0.150.128000, ARM640.142.5The failure is:
A read-only sanitized inspection found the rollout present and parseable: one
session_meta, 595turn_contextrecords, 88,715 JSONL records, and zero invalid JSON lines. I did not modify the database or rollout.A writer may still be live in the other surface. The user-visible problem is that the TUI reports only an opaque conflict. It does not identify the owning process or surface, offer observer mode, or provide a safe handoff action.
I uploaded the affected thread ID and diagnostics privately through
/feedback.Uploaded thread:
01a0470d-0700-71b0-8afb-875b432c5088emmett2020 commentedon Aug 29, 2026
I met the same issue when I closed the codex with ctrl-X and then re-enter this codex session with 'resume'.
PhiFever commentedon Aug 31, 2026
Just use
and kill the old codex process can fix it
hyperpolymath commentedon Aug 31, 2026
Additional user report on codex-cli 0.151.0 under WSL2/Windows Terminal: while editing a prompt, the user instinctively pressed Ctrl-X as the familiar clipboard cut shortcut. The TUI disappeared, and attempting to resume immediately failed with the exact active-writer error reported here.
The usability impact is larger than an obscure key collision: Ctrl-X is a deeply learned clipboard/editing gesture, so binding a lone press to an immediate exit can unexpectedly disrupt a long conversation and make users reasonably fear that their thread has been lost.
Please consider making Ctrl-X non-destructive by default, or requiring a confirmation/second press before exiting. If another writer remains active after an exit, the resume error should identify the owning process or surface and offer a safe attach/handoff/retry path. Configurable keymaps provide a local workaround, but users should not need to discover and remap a common clipboard shortcut after losing access to a session.
brassdylan commentedon Sep 3, 2026
Additional macOS reproduction on Codex CLI 0.153.0 (Apple Silicon, running under tmux).
This happened multiple times today while switching/resuming local TUI sessions. In the most recent case:
codex resume <thread-id>.The second Ctrl-C is another SIGINT, not SIGKILL, but it appears to expose a teardown race between the TUI, the Node wrapper, and the native Codex process. Local logs recorded repeated active-writer conflicts for the same thread across several minutes. The rollout remained present and ended with a normal completed turn; no rollout or database repair was needed.
In this incident, stopping the abandoned Codex process/session eventually released the writer, and a clean resume then succeeded. The error did not identify the owning process or provide an attach, handoff, or safe recovery action. A separate thread showed the same error when an older TUI was still alive in another tmux pane, which made it difficult to distinguish “another active owner” from a stranded writer.
Expected behavior:
lsofand manually reason about process lifetimes.I have intentionally omitted usernames, repository paths, thread IDs, and raw transcripts.