codex - 💡(How to fix) Fix macOS/Kitty: TUI can remain non-reactive after task_complete while process stays busy [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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…
GitHub stats
openai/codex#19331Fetched 2026-04-25 06:11:31
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Author
Timeline (top)
labeled ×3commented ×1cross-referenced ×1unlabeled ×1

Error Message

After task_complete, the TUI should return to a reactive input state, or at least expose a recoverable error state. The original tab should not remain in a busy/non-reactive state after completion is recorded.

Fix Action

Workaround

I built a local recovery script that:

  1. discovers live Kitty/Codex tabs
  2. maps each live process back to its .codex/sessions/**/*.jsonl
  3. flags live windows whose rollout ends in task_complete as stale
  4. preserves raw JSONL, markdown export, and visible Kitty screen text
  5. launches codex fork or codex resume in a new Kitty tab
  6. only closes the old stale Kitty tab after the replacement tab is confirmed alive

I can provide more diagnostics if there is a preferred debug command or log source for TUI state.

Code Example

source: live Kitty window with Codex process
kitty state: busy / not shell prompt
jsonl last event: event_msg.task_complete
diagnosis: stale-ui

---

codex fork --no-alt-screen <session-id>
# or
codex resume --no-alt-screen <session-id>
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

0.124.0

What platform is your computer?

macOS 26.4.1 arm64

What terminal emulator and version are you using?

Kitty 0.46.1

What issue are you seeing?

I observed multiple Codex CLI TUI sessions where the terminal UI became non-reactive while the session transcript had already recorded completion.

The important state mismatch:

  • the live Kitty tab still contained a running Codex process
  • Kitty reported the window as not at a shell prompt, so the tab looked busy
  • the corresponding Codex JSONL rollout's last event was event_msg / task_complete
  • the UI did not accept useful interaction in the original tab
  • this happened in more than one live Kitty tab on the same machine

This made the session look stuck even though the recorded task had completed. I had to preserve the JSONL transcript and visible Kitty screen, then launch a fresh codex fork/codex resume tab.

Local diagnosis method

I correlated the live Kitty window with the Codex session JSONL using kitty @ ls, lsof -p <codex-pid>, and the latest event in the rollout file.

The stale condition was:

source: live Kitty window with Codex process
kitty state: busy / not shell prompt
jsonl last event: event_msg.task_complete
diagnosis: stale-ui

A fresh revive-launched tab can be created with:

codex fork --no-alt-screen <session-id>
# or
codex resume --no-alt-screen <session-id>

Expected behavior

After task_complete, the TUI should return to a reactive input state, or at least expose a recoverable error state. The original tab should not remain in a busy/non-reactive state after completion is recorded.

Actual behavior

The original Kitty tab stayed alive but non-reactive. The transcript was complete on disk, but the TUI did not recover.

Related issues

This appears related to stale TUI/busy-state reports such as:

  • #16904
  • #12645
  • #14314

but this report is specifically macOS + Kitty + Codex CLI 0.124.0, with the observed mismatch between live Kitty state and JSONL task_complete.

Workaround

I built a local recovery script that:

  1. discovers live Kitty/Codex tabs
  2. maps each live process back to its .codex/sessions/**/*.jsonl
  3. flags live windows whose rollout ends in task_complete as stale
  4. preserves raw JSONL, markdown export, and visible Kitty screen text
  5. launches codex fork or codex resume in a new Kitty tab
  6. only closes the old stale Kitty tab after the replacement tab is confirmed alive

I can provide more diagnostics if there is a preferred debug command or log source for TUI state.

extent analysis

TL;DR

The issue can be mitigated by using the --no-alt-screen flag with codex fork or codex resume to launch a new tab and recover from the non-reactive state.

Guidance

  • The problem seems to be related to the TUI not recovering after a task is completed, leaving the Kitty tab in a busy/non-reactive state.
  • To verify if a tab is in a stale state, check the last event in the corresponding JSONL rollout file for event_msg.task_complete and compare it with the live Kitty window state.
  • Using the --no-alt-screen flag with codex fork or codex resume can help recover from this state by launching a new tab.
  • The provided local recovery script can be used as a temporary workaround to automate the process of identifying and recovering from stale tabs.

Example

codex fork --no-alt-screen <session-id>

or

codex resume --no-alt-screen <session-id>

Notes

The issue appears to be specific to macOS, Kitty, and Codex CLI 0.124.0, and may be related to other reported issues (#16904, #12645, #14314).

Recommendation

Apply the workaround using the --no-alt-screen flag with codex fork or codex resume to recover from the non-reactive state, as it provides a reliable way to launch a new tab and resume the session.

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

After task_complete, the TUI should return to a reactive input state, or at least expose a recoverable error state. The original tab should not remain in a busy/non-reactive state after completion is recorded.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING