Repository navigation
Description
What version of Codex CLI is running?
codex-cli 0.153.4
What subscription do you have?
Pro
Which model were you using?
GPT-5.6-Sol
What platform is your computer?
Darwin 25.6.0 arm64 arm
What terminal emulator and version are you using (if applicable)?
tmux
Codex doctor report
{
"note": "Full report omitted because it contains organization-
specific paths, MCP names, and endpoint-security metadata.",
"codexVersion": "0.153.4",
"platform": "macos-aarch64",
"installMethod": "Homebrew",
"authMode": "chatgpt",
"model": "gpt-5.6-sol",
"modelProvider": "openai",
"terminal": "iTerm2 3.6.11 with tmux 3.6a",
"latestVersion": "0.153.4"
}What issue are you seeing?
When the TUI resumes an existing app-server thread, it can display
“Working (… • esc to interrupt)” indefinitely even though the
authoritative thread status is Idle and no turn is running.
Escape does not clear it because it sends a real turn/interrupt
request, but there is no active turn to interrupt. If a genuine turn
begins later, Escape interrupts that real turn while the stale Working
footer remains.
This is a TUI rendering-state bug rather than a hung model request.
What steps can reproduce the bug?
- Begin a Codex turn.
- End the app-server uncleanly while the turn is active, leaving a
persisted task_started without a subsequent task_complete,
turn_aborted, or other terminal event. - Restart the app-server.
- Attach the TUI using:
codex --remote ws://127.0.0.1: resume - Confirm that the resumed thread is Idle and has no active turn.
- Observe that the TUI nevertheless displays a permanent Working
footer. - Press Escape. The footer remains because no live turn exists to
complete or interrupt.
This lifecycle signature was verified in the affected rollout.
What is the expected behavior?
The TUI should use the resumed thread’s current ThreadStatus as the
authority for its activity indicator.
A historical InProgress turn should restore the Working footer only
when the live thread is Active. If the thread is Idle, the TUI should
render idle.
Additional information
During typed turn replay,
replay_thread_turns
unconditionally calls on_task_started() for every historical
TurnStatus::InProgress:
if matches!(status, TurnStatus::InProgress) {
// ...
self.on_task_started();
}However,
AppServerStartedThread
does not carry the live ThreadStatus, and
started_thread_from_resume_response
copies response.thread.turns into the TUI bootstrap state while discarding
response.thread.status.
That lets a stale historical InProgress turn activate the local Working
widget even when the authoritative resumed thread is Idle. Since no live turn
exists, no later turn-completed event is guaranteed to clear the widget.
This looks like the same invariant addressed by #11852 / #12420 ("replayed
history must not force live active state") reappearing through the newer typed
turn replay path.
Suggested fix and regression cases
Carry the live ThreadStatus through the resumed-thread bootstrap and only
restore task-running UI from historical InProgress when the live thread is
actually Active. Also reconcile a live transition to Idle by clearing stale
task-running UI when no active turn remains.
Suggested tests:
ThreadStatus::Idle+ historicalTurnStatus::InProgress=> no Working
widget.ThreadStatus::Active+ historicalTurnStatus::InProgress=> Working
widget is restored.- A legitimately active resumed thread receives
ThreadStatusChanged(Idle)=> Working widget clears. - Resume an idle thread, then receive a real live
turn/started=> Working
widget appears normally.
#40563 is useful corroboration but a different layer: it documents the
producer-side persistence contradiction where history remains inProgress
while thread/resume reports an idle, input-capable runtime. This comment is
about the consumer-side TUI behavior when it receives that contradiction.
Activity
argszero commentedon Sep 9, 2026
Confirmed your analysis is still accurate on current
origin/main(the code has not drifted from the referenced refs). This is a real consumer-side TUI state bug, and the fix shape you describe is the right one. Verified today against origin/main (HEADdafb6781ee):1.
replay_thread_turnsstill unconditionally restores task-running UI.codex-rs/tui/src/chatwidget/replay.rs, in thematches!(status, TurnStatus::InProgress)arm, still doesself.on_task_started()with no guard on the live thread's status:2.
AppServerStartedThreadcarries noThreadStatus.codex-rs/tui/src/app_server_session.rs:3.
started_thread_from_resume_responsediscardsresponse.thread.status. It copiesturns: response.thread.turnsand drops the status thatThreadResumeResponse.threadalready carries:So when a resumed thread is authoritatively
Idlebut its persisted history ends in a historicalTurnStatus::InProgress(the staletask_started/ no-terminal-event signature you describe), the replay seeds the Working widget and nothing downstream clears it, because no live turn will ever emit a terminal event.Fix design — I agree with your shape. Carry
response.thread.statusintoAppServerStartedThread, and inreplay_thread_turnsgate theon_task_started()restore on the live thread beingActive, and reconcile a liveThreadStatusChanged(Idle)by clearing the stale task-running UI.ThreadResumeResponse.threadalready exposes.status, so this is a plumbing change (thread aThreadStatusfield through the bootstrap) plus a render guard + the idle-reconciliation path — self-contained and low-risk.Your four suggested regression cases map cleanly onto the existing
turn_lifecycle/replay test harness. This is a good candidate for a focused PR. If you'd like a hand, I'm happy to take a pass at the implementation — otherwise I'll leave the design endorsement here. (For context, #40563 is indeed the same producer-side invariant and corroborates the consumer-side fix being additive, not overlapping.)nathantimothym-coder commentedon Sep 9, 2026
Go for it!
issue-proofs: 5 port tests for upstream TUI issues (openai#12882, ope…
fix-resume-inprogress: a resume page starts its unfinished turn only …
etraut-openai commentedon Nov 27, 2026
Thanks for the bug report. This will be addressed in an upcoming release.