Skip to content

TUI turn interrupt failure can lose session context #24518

Open

Description

@0xZOne

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.

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    windows-osIssues related to Codex on Windows systems
    TUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal display
    app-serverIssues involving app server protocol or interfaces
    sessionIssues involving session (thread) management, resuming, forking, naming, archiving
    on May 26, 2026
  2. github-actions commented on May 26, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. etraut-openai commented on May 26, 2026

    @etraut-openai
    Contributor

    If you see this happen again, please use /feedback to upload the logs, then post the session ID here.

  4. jshaofa-ui commented on May 26, 2026

    @jshaofa-ui
  5. jshaofa-ui commented on May 26, 2026

    @jshaofa-ui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLITUIIssues related to the terminal user interface: text input, menus and dialogs, and terminal displayapp-serverIssues involving app server protocol or interfacesbugSomething isn't workingsessionIssues involving session (thread) management, resuming, forking, naming, archivingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions