TUI: use cumulative turn duration for worked-for separator#19929
Merged
etraut-openai merged 1 commit intomainfrom Apr 28, 2026
Merged
TUI: use cumulative turn duration for worked-for separator#19929etraut-openai merged 1 commit intomainfrom
etraut-openai merged 1 commit intomainfrom
Conversation
fcoury-oai
approved these changes
Apr 28, 2026
Contributor
fcoury-oai
left a comment
There was a problem hiding this comment.
I was able to replicate the issue on alpha codex and confirmed the fix works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Why
Fixes #19814.
The TUI's current
Worked for ...timing behavior is a leftover from #9599. At that point, models could emit multiple assistant messages in one turn for preambles/commentary, but the TUI did not yet have a reliable signal that an assistant message was the final answer when it started streaming. To avoid showing an ever-growing elapsed time on each preamble separator, #9599 made the separator timer incremental by tracking elapsed time since the previous separator.That workaround is no longer the right model for the final completed-turn display. Since then, #16638 added protocol-native turn timing, including
duration_mson turn completion. With that cumulative duration available at the point where the TUI renders the completed-turn separator, the UI can show the actual turn duration directly instead of carrying per-separator timing state.What Changed
duration_msintoChatWidget::on_task_completefrom both legacyTurnCompleteEventhandling and app-serverTurnCompletednotifications.duration_msfor the finalWorked for ...separator, falling back to the status indicator timer only when the protocol duration is unavailable.Worked for ...separators.last_separator_elapsed_secs/worked_elapsed_from).Verification
cargo test -p codex-tui final_worked_for_uses_cumulative_turn_duration_snapshotjust fix -p codex-tuiManual repro prompt:
After this change, the mid-turn break before the final answer should be a plain divider, and the final completed-turn separator should show
Worked for ...using the cumulative turn duration.Before:

After:
