feat(analytics): consolidate agent run, token, and cost observability - #469
Merged
Conversation
- Apply cache_control to conversation history blocks - Track cache miss/creation tokens - Add UI indicator for silent cache degradation - Add Cached Tokens column to Executions list view
Adds segment_tokens (system/tools/knowledge/history/message token composition) and prefix_breakpoints (per-breakpoint cache prefix hashes) into the existing usage_snapshot field, plus a compute_run_metrics helper producing cache read share, effective input multiplier, wasted-writes tracking, prefix stability, and counterfactual savings. Adds a get_run_context_metrics API and a reusable ContextBar component wired into the Agent Run detail page's new Context card.
…o consolidation/agent-run-analytics
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
Consolidates the complete execution analytics and usage-observability work from #445 into one reviewable PR.
Included from #445
Design boundaries
cached_tokensandcostcompatibility fields remain intact.Validation
git diff --checkpassed.yarn typecheck, productionyarn build, migration, analytics tests, and live hourly/daily rollup/API verification.Source PR
Follow-up