Feat/tool call timestamps#1
Merged
Merged
Conversation
Each tool block (BlockTool + InlineTool) now renders `HH:MM:SS · 1.2s`
in the title row. Running tools tick the elapsed counter at 1Hz and
freeze on completion; tools running >=30s switch to theme.warning so
slow calls stand out at a glance.
- Add Locale.clockTime() for 24-hour HH:MM:SS formatting.
- Add useElapsed(part) hook: returns {start, ms, running}; live-ticks
only while status === "running" and cleans up the interval on
transition to completed/error.
- Gate visibility behind the existing showTimestamps toggle; default
flipped from "hide" -> "show". Toggle relabeled "Show tool timing"
and aliased to /timing in addition to /timestamps.
- Pending parts (no time.start yet) render no timing row, so the UX
stays clean during the brief pre-running window.
Tests: 2 new Locale.clockTime cases; existing TUI suite (157) still
passes; tsgo typecheck clean.
Aggregates duration across every ToolPart in the session — completed and error tools by (end - start), the currently running tool by (now - start), live-ticking once a second only while a tool is running. Renders under the existing Context block as '… in tools' (with a '(running)' suffix when active), hidden when zero.
Pulls SLOW_TOOL_MS, the Elapsed type, and the 'HH:MM:SS · running …' suffix builder into routes/session/timing.ts. Collapses three copies of the timing format string across InlineTool and BlockTool down to a single formatElapsed() call, and drops a redundant 'as ToolPart' cast in the sidebar — the part.type === 'tool' discriminant already narrows the union.
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.
Summary
Adds visibility into how long tool calls take inside the TUI — both per-call and at the session level.
What changed and why?
Test Plan
Checklist