Repository navigation
feat: expose bounded thread usage lineage telemetry - #527
GraciousGazelles wants to merge 13 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces an experimental thread/usageSummary endpoint to provide read-only lineage and usage telemetry for persisted thread families. The changes include new protocol definitions, database schema updates to track lineage, and logic for aggregating token and credit usage. The review feedback identifies a performance optimization for a SQL query to avoid full table scans, a fix for correctly aggregating the partial status in usage totals, and a suggestion for more idiomatic credit estimation logic.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the experimental thread/usageSummary endpoint to retrieve read-only lineage and usage telemetry for a persisted thread family. It adds the necessary protocol definitions, request/response structs, message processing, and state runtime logic to query the local SQLite database, along with a database migration to track lineage_edge_kind and spawn_request_id directly on threads. Feedback was provided regarding a performance issue in the SQL query within get_usage_lineage_telemetry, where the CTEs perform full table scans and aggregations before filtering. The reviewer suggested introducing a family_threads CTE to filter the relevant thread IDs first, allowing SQLite to utilize indexes and avoid scanning entire tables.
73ddc12 to
3ac14ca
Compare
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
051220e to
6b505cc
Compare
Summary:
Validation:
Hosted validation is required for Rust compilation, generated protocol artifacts, and integration coverage.