feat: add tool registry for CC tool introspection#940
Merged
OneStepAt4time merged 1 commit intomainfrom Apr 3, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Tool registry is a reasonable MVP for CC tool introspection. One concern:
processEntries() double-counts on re-read: The endpoint /v1/sessions/:id/tools calls readNewEntries(path, 0) which re-reads ALL entries from offset 0 every time. If processEntries is called twice, it will double-count all tool uses. Consider tracking lastProcessedOffset per session, or deduplicating by entry index/timestamp.
Otherwise: cleanup on session kill is correct, tool definitions are sensible, endpoint structure is clean. Approved with note above — please address the double-count before merging or accept the limitation as documented.
Contributor
Adds tool usage tracking and registry endpoints: - GET /v1/sessions/:id/tools — list tools used in a session with usage counts, error counts, and timestamps - GET /v1/tools — list all known CC tool definitions with categories Tool definitions include name, category (read/write/edit/bash/search/agent/mcp), description, and permission level. Session tool usage is parsed from JSONL transcripts on-demand. Fixes #704
ca6185a to
f5b31b8
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.
Summary
Adds tool usage tracking and registry endpoints for CC tool introspection and analytics.
Changes
ToolRegistryclassGET /v1/sessions/:id/tools— tool usage for a session (parsed from JSONL on-demand)GET /v1/tools— all known CC tool definitions with categoriesTesting
Fixes #704