codex - ✅(Solved) Fix Codex no longer shows reliable full prompt elapsed time [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

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#19814Fetched 2026-04-28 06:36:40
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Participants
Assignees
Timeline (top)
labeled ×3assigned ×1cross-referenced ×1unlabeled ×1

PR fix notes

PR #19929: TUI: use cumulative turn duration for worked-for separator

Description (problem / solution / changelog)

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_ms on 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

  • Thread duration_ms into ChatWidget::on_task_complete from both legacy TurnCompleteEvent handling and app-server TurnCompleted notifications.
  • Use duration_ms for the final Worked for ... separator, falling back to the status indicator timer only when the protocol duration is unavailable.
  • Keep mid-turn separators before later assistant text as plain visual dividers instead of clocked Worked for ... separators.
  • Remove the old incremental separator timer state and helper (last_separator_elapsed_secs / worked_elapsed_from).
  • Add a snapshot regression test for a turn that runs a command and then completes with a final answer, verifying the final separator uses the cumulative turn duration.

Verification

  • cargo test -p codex-tui final_worked_for_uses_cumulative_turn_duration_snapshot
  • just fix -p codex-tui

Manual repro prompt:

Manual timing repro. First send a short preamble/commentary sentence before using tools. Then run exactly this shell command: sleep 75; echo MANUAL_TIMING_DONE. After the command finishes, give a final answer that says "done". Do not skip the preamble.

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: <img width="414" height="102" alt="Screenshot 2026-04-27 at 10 09 01 PM" src="https://github.com/user-attachments/assets/b9e2ce01-2460-40e4-a5c4-c9ba8add2557" />

After: <img width="485" height="149" alt="Screenshot 2026-04-27 at 10 09 07 PM" src="https://github.com/user-attachments/assets/d24089ae-d4e2-41b6-b966-07c98706ead4" />

Changed files

  • codex-rs/tui/src/chatwidget.rs (modified, +29/-37)
  • codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__final_worked_for_uses_cumulative_turn_duration.snap (added, +12/-0)
  • codex-rs/tui/src/chatwidget/tests/exec_flow.rs (modified, +56/-2)
  • codex-rs/tui/src/chatwidget/tests/helpers.rs (modified, +0/-1)
  • codex-rs/tui/src/chatwidget/tests/plan_mode.rs (modified, +20/-6)
  • codex-rs/tui/src/chatwidget/tests/status_and_layout.rs (modified, +3/-11)
  • codex-rs/tui/src/history_cell.rs (modified, +1/-1)
RAW_BUFFERClick to expand / collapse

What version of Codex CLI is running?

codex-cli 0.125.0

What subscription do you have?

API key

Which model were you using?

gpt-5.5

What platform is your computer?

Darwin 25.4.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

iTerm2

What issue are you seeing?

Codex used to make it easy to see how long a full prompt/turn took, from submission until the agent stopped. Recently, the displayed Worked for ... duration is missing or no longer reliable. For long-running prompts, I need the total wall-clock time for the whole turn, not a reset/truncated status duration.

This seems related to existing reports about Worked for ... resetting or not being cumulative.

What steps can reproduce the bug?

  1. Start Codex CLI/TUI.
  2. Submit a prompt that takes several minutes or longer.
  3. Wait until the turn fully completes.
  4. Check the final displayed duration.

Observed: the UI does not reliably show the full time from prompt submission to completion.

What is the expected behavior?

Codex should show a stable cumulative elapsed time for each turn: from when I submit the prompt until Codex fully stops.

Additional information

No response

extent analysis

TL;DR

The issue with the unreliable "Worked for ..." duration display in Codex CLI may be related to existing reports of the duration resetting or not being cumulative, and a potential fix could involve modifying the duration calculation or display logic.

Guidance

  • Review existing reports and issues related to the "Worked for ..." duration resetting or not being cumulative to see if there are any known workarounds or fixes.
  • Verify that the issue is not specific to the gpt-5.5 model or the Darwin 25.4.0 arm64 arm platform by testing with different models and platforms.
  • Check the Codex CLI documentation and source code (if available) to see if there are any configuration options or code changes that can be made to modify the duration calculation or display logic.
  • Consider submitting a feature request or bug report to the Codex CLI developers to request a fix for the unreliable duration display.

Notes

The issue may be specific to the Codex CLI version 0.125.0, and upgrading to a newer version may resolve the issue, but this is not explicitly stated in the issue.

Recommendation

Apply workaround: Since the issue is likely related to existing reports of the duration resetting or not being cumulative, applying a workaround such as manually tracking the duration or using a different tool to measure the elapsed time may be the best course of action until a fix is available.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

codex - ✅(Solved) Fix Codex no longer shows reliable full prompt elapsed time [1 pull requests, 1 participants]