Skip to content

Ctrl+C can leave session locked with stale active writer, preventing resume #43374

Open

Description

@NightSparrows

Summary

Pressing Ctrl+C while using Codex CLI can leave the current session stuck as having an active writer. After restarting Codex and trying to resume the same session, resume fails with an already has an active writer error.

Environment

  • Codex CLI: 0.153.4
  • Platform: Linux

Steps to reproduce

  1. Start codex.
  2. Work in a session normally.
  3. Press Ctrl+C while Codex is running/working.
  4. Start Codex again.
  5. Attempt to resume the previous session.
  6. Resume fails because the thread is reported as already having an active writer.

Actual behavior

thread/resume failed during TUI bootstrap: thread/resume failed: thread <thread-id> already has an active writer (code -32600)

The previous Codex process has already exited, but the writer ownership appears to remain stale, so the session cannot be resumed normally.

Expected behavior

Ctrl+C should cleanly release the thread writer/ownership before exiting, or stale writer ownership should be detected and recovered automatically when resuming.

A session should not become unusable simply because the previous Codex process was interrupted with Ctrl+C.

Suggested fix

Either:

  • gracefully release the active writer on SIGINT, or
  • detect that the previous writer no longer exists and reclaim the session on resume.

This has happened repeatedly and is easy to trigger accidentally in a terminal.

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    app-serverIssues involving app server protocol or interfaces
    on Sep 7, 2026
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 CLIapp-serverIssues involving app server protocol or interfacesbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions