Repository navigation
CLI: resume can get stuck on Working after unclean disconnect/shutdown of an active turn #12382
Description
What version of Codex CLI is running?
codex-cli 0.104.0
What subscription do you have?
ChatGPT Plus
Which model were you using?
Primarily gpt-5.3-codex
What platform is your computer?
Linux x86_64 (Ubuntu 25.10, kernel 6.17.0-14-generic)
What terminal emulator and version are you using (if applicable)?
zsh terminal on Linux
What issue are you seeing?
codex resume <thread-id> can get stuck on Working for long-lived threads after an unclean disconnect/shutdown (for example interrupt while a tool call is still running, then close/kill session and later resume).
This is thread-specific. Fresh/new sessions usually work.
MCPs do not seem to be the root cause:
- Repro still occurs with MCPs disabled.
- Re-enabling/disabling MCP does not eliminate recurrence.
What steps can reproduce the bug?
- Start a long-running turn in Codex (for example a command that requires repeated polling /
write_stdinupdates). - Interrupt / terminate the Codex process uncleanly while that turn is still active (Ctrl+C / shutdown / disconnect).
- Run
codex resume <same-thread-id>. - Observe resume opening but staying stuck on
Workingwith no progress.
What is the expected behavior?
Resume should recover cleanly from interrupted turns (or mark them aborted) and allow normal interaction, rather than remaining in a stale in-progress state.
What is the actual behavior?
The resumed thread often appears stuck in a stale in-progress state (Working) until manual JSONL repair.
Evidence (from local logs/session state)
Observed on 2026-02-20:
-
Thread file:
- stored under
~/.codex/sessions/.../rollout-*.jsonl - size: ~
300 MB - lines: ~
73k
- stored under
-
Tail boundary indicates incomplete turn:
last_task_started=2026-02-20T22:29:02.373Zlast_task_complete=2026-02-20T21:35:53.389Z
-
Log sequence shows unclean interruption/shutdown followed by resume + fallback warnings:
2026-02-20T22:28:29Zinterrupt received2026-02-20T22:28:30Zshutting down Codex instance2026-02-20T22:28:54Zresumed rollout successfully- repeated warnings:
state db record_discrepancy: find_thread_path_by_id_str_in_subdir, falling_back
Workaround
I can recover by trimming session JSONL to the last event_msg task_complete boundary (with backup), then resume works again.
That workaround strongly suggests the resume path is not robust to interrupted in-flight turns.
Related issues
Possibly related to:
- Resume after reconnecting can show stale working state without model invocation #11852 (stale
Workingafter reconnect) - Unable to resume large conversations #11685 (unable to resume large conversations)
Request
Could Codex automatically harden resume against this pattern by detecting/recovering incomplete tails (e.g., task_started newer than task_complete) after unclean shutdown/disconnect?
Activity
github-actions commentedon Feb 20, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
etraut-openai commentedon Oct 12, 2026
(response from codex)
Closing as fixed: resumed history no longer reactivates a stale Working state (#12420), and cold resume marks unfinished turns interrupted when the thread is idle (#14125). Both fixes are included in CLI 0.162.1. Please reopen if an unclean disconnect still leaves a thread stuck.