TUI turn interrupt failure can lose session context
What version of Codex CLI is running?
codex-cli 0.133.0
What operating system are you using?
Windows 11 / Windows NT 10.0.22631.0
Shell: Windows PowerShell 5.1.22621.4249
What issue are you seeing?
The Codex TUI can fail an active turn interrupt with:
Error: turn/interrupt failed in TUI
After this happens, the active session loses usable conversation context. Continuing from the TUI behaves like the prior turn/session state is no longer recoverable, so the user has to restart or reconstruct the context manually.
This is particularly painful during long coding sessions because the failure happens while trying to interrupt/steer an active turn, and the resulting context loss discards the working state that the user expected Codex to preserve.
Expected behavior
Interrupting an active turn from the TUI should either:
- cancel/interrupt the active turn and keep the existing thread context usable, or
- fail gracefully with a recoverable state and clear instructions.
It should not leave the TUI in a state where the conversation context is lost.
Actual behavior
- The TUI displays
Error: turn/interrupt failed in TUI. - The active turn/session context is no longer usable afterward.
- The exact UI-visible error string does not appear to be persisted verbatim in
~/.codex/log/codex-tui.log. - Around the observed failure window, the log shows new
session_loopthread ids being created, which matches the user-visible context-loss behavior.
Reproduction notes
I do not yet have a minimal deterministic reproduction. The observed setup was:
- Start
codexin the TUI on Windows from a large repository. - Run a long coding turn with tool calls.
- Interrupt the active turn from the TUI.
- Observe
Error: turn/interrupt failed in TUI. - Try to continue the session and find that the previous context is lost/unusable.
Environment details
- Codex CLI:
0.133.0 - OS:
Microsoft Windows NT 10.0.22631.0 - Shell: Windows PowerShell
5.1.22621.4249 - Workspace type: large Chromium-derived repository
- Model in the surrounding logged turn:
gpt-5.5withreasoning_effort=xhigh
Related issues
This looks related to the broader TUI/app-server active-turn state handling class of issues, but the symptom here is specifically the local TUI interrupt path failing with turn/interrupt failed in TUI and causing user-visible context loss.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗