feat: show timestamp and duration on tool execution blocks#22145
Open
kshptl wants to merge 1 commit intoanomalyco:devfrom
Open
feat: show timestamp and duration on tool execution blocks#22145kshptl wants to merge 1 commit intoanomalyco:devfrom
kshptl wants to merge 1 commit intoanomalyco:devfrom
Conversation
Contributor
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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