feat: show timestamp and duration on tool execution blocks - #22145
feat: show timestamp and duration on tool execution blocks#22145kshptl wants to merge 3 commits into
Conversation
|
The following comment was made by an LLM, it may be inaccurate: Potential Related PR Found:
Note: PR #22145 is the current PR, so it's excluded from the duplicate list. |
Display clock time and running duration on every tool execution block in both web UI and TUI. Interrupted tools show 'Interrupted' in red instead of a misleading duration. Closes anomalyco#22144
b0c1a0a to
71ba4ed
Compare
|
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:
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. |
|
This PR is still active and being worked on. The linked issue #22144 is still active too: it is open, was assigned to @jlongster, and received a new comment today. Please do not treat this as closed; I am continuing the work here. |
Issue for this PR
Closes #22144
Type of change
What does this PR do?
Shows a clock timestamp and running duration on every tool execution block in both the web UI and TUI. While a tool is running, the timer ticks live every second. Once completed, it freezes at the final duration.
Interrupted/aborted tools display "Interrupted" in red instead of a misleading "0s" duration.
Web UI: New shared utility module (
tool-timing.ts) with locale-aware formatting viaIntl.DateTimeFormat/Intl.NumberFormat. Reactive SolidJS hooks track timing state per tool part. Timing appears on all tool types — reads, edits, grep, bash, tasks, etc.TUI: Extracted
createTiminghook used by bothBlockToolandInlineTool(including spinner branch for running tools). Local formatting helpers use system locale.Backend fix:
prompt.tsnow preserves the existingstarttimestamp when a tool's metadata callback fires during execution, preventing the timer from resetting mid-run. Task-tool cancellation setsmetadata.interrupted: true.How did you verify your code works?
bun typecheckclean across all 13 packages (runs via pre-push hook)packages/uicovering duration formatting, header timing, zero-duration edge cases, and interrupt detectionprocessor.ts— timing survives all transitions (pending → running → completed/error)Screenshots / recordings
Screenshots of the running timer and interrupted state to be added.
Checklist