feat(analytics): per-agent cost breakdown and clickable Gantt timeline#363
Merged
Conversation
…eline - Extract sub-agent token usage by matching tool_use IDs against agent-<id>.meta.json - Enrich each agent dispatch with costUSD and token breakdown from its transcript - Add clickable timeline bars; side panel shows cost, tokens, duration, tool calls per agent - Scope Gantt scale to agent activity window so bars fill the track proportionally - Agent-only bars in Gantt (skills/commands removed per spec); proportional wall-clock scaling - Fix: costUSD omitted when no model has a pricing entry (was incorrectly set to $0) - Fix: agent description removed from dispatch name fallback (prevented info leaking into reports) - Fix: tl-bar min-width 28px; bar left uses calc(min(..., 100%-28px)) to prevent clip at track edge - Fix: tl-dur column narrowed to 72px to reduce gap between bars and duration label Generated with AI Co-Authored-By: codemie-ai <codemie.ai@gmail.com>
8nevil8
approved these changes
Jun 15, 2026
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
agent-<id>.meta.jsonto match eachAgenttool_use to its sub-agent transcript, then prices token usage per model and attachescostUSD/tokensto each dispatch eventmin-width: 28pxwithcalc(min(..., 100%-28px))prevents right-edge clipping;tl-durcolumn narrowed from 120px to 72pxCode-review fixes applied
descriptionfrom agent dispatch name fallback (prevented long/sensitive text leaking into reports)costUSDnow omitted (not set to$0) when no model has a pricing entrysettings.jsontelemetry additions to keep them out of this PR scopeTest plan
costUSDis absent (not$0) for agents whose model is not in the pricing tablenpm run lint && npm run build && npm test— confirm 2161 tests pass (1 pre-existing failure inskills.test.tsunrelated to this branch)