Skip to content

feat: add elapsed timer display for tools and turns - #38675

Closed
feng653 wants to merge 1 commit into
anomalyco:devfrom
feng653:elapsed-timer
Closed

feng653 wants to merge 1 commit into
anomalyco:devfrom
feng653:elapsed-timer

Conversation

@feng653

@feng653 feng653 commented Jul 24, 2026 •

Copy link
Copy Markdown

Issue for this PR

Closes #38666

Type of change

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

What does this PR do?

Shows how long each tool call takes, plus the elapsed time of the current turn:

  • TUI: duration next to each inline tool row (live while running), and a live elapsed counter in the prompt area
  • Web/Desktop (session-ui): duration in the tool row header via BasicTool (running tools tick every second), and the turn duration in the assistant text part footer
  • Durations render as 350ms / 3.2s / 1m 5s via a small shared formatDuration helper (same style as the existing TUI Locale.duration)

All timing data (state.time.start/end on tool parts, time.created/completed on messages) is already synced to clients - no server, schema, or protocol changes. Rendering only.

How did you verify your code works?

  • bun typecheck passes in packages/session-ui, packages/app, and packages/tui
  • Ran the TUI from source and the web app dev server; confirmed durations appear on tool rows, tick live while running, and that the turn total shows in the footer

Screenshots / recordings

Screenshots of the TUI and web UI will be attached in a comment below.

Checklist

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

Related: #36099

@feng653

feng653 commented Jul 24, 2026

Copy link
Copy Markdown
Author

pic1(app):not finish

Image

pic2(app): finished
Image
pic3(TUI):finished
Image
pic4(TUI):not finished
Image

@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 per-tool elapsed time and turn duration in TUI and web UI

1 participant