codex - 💡(How to fix) Fix TUI turn interrupt failure can lose session context

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error: turn/interrupt failed in TUI

Root Cause

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.

Code Example

Error: turn/interrupt failed in TUI
RAW_BUFFERClick to expand / collapse

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_loop thread 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:

  1. Start codex in the TUI on Windows from a large repository.
  2. Run a long coding turn with tool calls.
  3. Interrupt the active turn from the TUI.
  4. Observe Error: turn/interrupt failed in TUI.
  5. 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.5 with reasoning_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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

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.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING