Skip to content

feat(tui): show assistant turn completion time#37929

Open
EZotoff wants to merge 1 commit into
anomalyco:devfrom
EZotoff:feat/turn-summary-completion-time
Open

feat(tui): show assistant turn completion time#37929
EZotoff wants to merge 1 commit into
anomalyco:devfrom
EZotoff:feat/turn-summary-completion-time

Conversation

@EZotoff

@EZotoff EZotoff commented Jul 20, 2026

Copy link
Copy Markdown

Issue for this PR

Closes #35348

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Appends the wall-clock completion time after the duration in the TUI turn-summary line. The format follows the user's locale settings via the existing Locale.time() helper.

Before: ▣ Build · gpt-5 · 2.8s
After: ▣ Build · gpt-5 · 2.8s · 3:41 PM

Threads an optional time: string through the turn-summary pipeline:

  • runtime.queue.ts computes time: Locale.time(end) at the same Date.now() capture used for duration, and emits it on the turn.duration FooterEvent.
  • types.ts adds time?: string to TurnSummary and time: string to the turn.duration event variant.
  • footer.ts forwards next.time into writeTurnSummary.
  • scrollback.surface.ts and turn-summary.ts accept and append · \${time} to the summary text when present.
  • scrollback.writer.tsx renders the optional suffix via the same ternary.
  • messageTurnSummaryCommit in turn-summary.ts passes time: Locale.time(completed) so session-replayed history also shows the timestamp.
  • packages/tui/src/routes/session/index.tsx AssistantMessage adds a completedTime memo and renders it inside the existing <Show when={duration()}> block — this is the path users see for completed turns.

This is a faithful revival of #32771, which was auto-closed by the needs:compliance bot within 2 hours of being opened for not matching the template. The original implementation and tests are preserved; attribution retained.

How did you verify your code works?

  • New test/cli/run/turn-summary.test.ts — unit test on turnSummaryCommit with and without time.
  • New case in scrollback.surface.test.ts — exercises writeTurnSummary with time and asserts the rendered row.
  • Updated 3 turn-summary assertions in session-replay.test.ts to expect · \${Locale.time(3000)} suffix.
  • Updated inline-tool-wrap-snapshot.test.tsx fixture + snapshot to include the time suffix.

33 opencode package tests pass; 17 TUI snapshot tests pass.

Screenshots / recordings

Text-only TUI change. Before/after captured above in What does this PR do?

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Co-authored-by: joeyparis joeyparis@users.noreply.github.com
Co-authored-by: Sisyphus clio-agent@sisyphuslabs.ai

Appends the wall-clock completion time after the duration in the TUI
turn-summary line, the scrollback turn-summary commit, and session
replay. Uses the existing Locale.time() helper which respects the
user's locale settings.

Closes anomalyco#35348
Revives anomalyco#32771 (auto-closed by the needs:compliance bot, not rejected
on merits — original implementation and tests are preserved here).

Co-authored-by: joeyparis <joeyparis@users.noreply.github.com>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
@EZotoff

EZotoff commented Jul 21, 2026

Copy link
Copy Markdown
Author

Heads up for reviewers — this is complementary to `/timestamps`, not a duplicate.

OpenCode v1.17.13+ shipped the `session.toggle.timestamps` keybind (packages/tui/src/config/keybind.ts:100) which toggles per-message timestamps next to each individual message in the scrollback (packages/tui/src/routes/session/index.tsx:1426).

This PR adds the timestamp to a different surface: the turn-summary line itself (▣ agent · model · duration), which is rendered by AssistantMessage and is not affected by the `/timestamps` toggle. Verified against plain origin/dev — the turn-summary line still has no time:

▣ Build · gpt-5 · 2.8s          ← current dev
▣ Build · gpt-5 · 2.8s · 3:41 PM ← this PR

If maintainers prefer, this could alternatively be gated behind the same `timestamps` kv signal so the two surfaces stay consistent — happy to revise in that direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Show message/run start and completion timestamps with millisecond precision

1 participant