Skip to content

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

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

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 [email protected]
Co-authored-by: Sisyphus [email protected]

@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.

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 <[email protected]>
Co-authored-by: Sisyphus <[email protected]>
@EZotoff
EZotoff force-pushed the feat/turn-summary-completion-time branch from 331aabf to d57ccec Compare August 7, 2026 09:10
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

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