fix(tui): restore working shimmer after preamble output #10701
Merged
+339
−240
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
When a turn streamed a preamble line before any tool activity,
ChatWidgethid the status row while committing streamed lines and did not restore it until a later event (commonlyExecCommandBegin). During that idle gap, the UI looked finished even though the turn was still active.Mental model
The bottom status row and transcript stream are separate progress affordances:
While stream output is actively committing, hiding the status row is acceptable to avoid redundant visual noise. Once stream controllers go idle, an active turn must restore the status row immediately so liveness remains visible across preamble-to-tool gaps.
Non-goals
ChatWidgetandBottomPane.Tradeoffs
Architecture
run_commit_tick_with_scopeinchatwidget.rsnow documents and enforces a two-phase contract:This keeps status ownership in
ChatWidgetwhile relying onBottomPanehelpers:hide_status_indicator()during active stream commitsensure_status_indicator()+set_status_header(current_status_header)at stream-idle boundaryDocumentation pass additions:
run_commit_tick_with_scope.Observability
Signal that the fix is present:
• Working (… esc to interrupt).codex_tui__chatwidget__tests__preamble_keeps_working_status.snap.Debug path for future regressions:
run_commit_tick_with_scopefor hide/restore transitions.bottom_pane.is_task_running()at idle transition.current_status_headercontinuity when status is recreated.Tests
streaming_final_answer_keeps_task_running_statenow expects status widget to remain present while turn is running.preamble_keeps_status_indicator_visible_until_exec_begin.preamble_keeps_working_status_snapshot.tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__preamble_keeps_working_status.snap.Commands run:
just fmtcargo test -p codex-tui preamble_keeps_status_indicator_visible_until_exec_begincargo test -p codex-tui preamble_keeps_working_status_snapshotRisks / Inconsistencies
commit tick,turn complete,exec begin), so future regressions can reintroduce ordering gaps.is_task_running()correctness; if task lifecycle flags drift, status behavior will drift too.