feat(analytics): add tool usage analysis (#983)#988
Open
rodboev wants to merge 3 commits into
Open
Conversation
roborev: Combined Review (
|
2582662 to
17d8feb
Compare
roborev: Combined Review (
|
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.
The tools analytics endpoint already scans
tool_calls, but the response only exposes category totals, per-agent category breakdowns, and trend buckets. That makes the analytics page useful for broad shape, but it cannot answer which concrete tools dominate usage under the active filters.This extends the existing
/api/v1/analytics/toolsresponse with a ranked per-tool analysis surface, keeping aggregation ininternal/db/analytics.goand preserving the existing category, agent, and trend fields. The Huma route continues to pass the typed response through, the frontend client is regenerated from the updated schema, and the analytics store plusToolUsage.svelterender the new rows without rebuilding filter logic in the browser.The scope is intentionally vertical but local to the existing tools analytics path. It does not add a new endpoint or change how tool calls are ingested.
Closes #983