feat(usage): aggregate token usage and expose in CLI view and across harnesses - #50
Open
Adityakk9031 wants to merge 2 commits into
Open
Adityakk9031 wants to merge 2 commits into
Adityakk9031 wants to merge 2 commits into
Conversation
…harnesses - Implement Default, total_tokens(), is_zero(), Add, AddAssign, and Sum for Usage in common.rs - Implement Transcript<Common>::total_usage() in transcript.rs - Preserve token usage in fx harness (events, session.json, and usage-v2.json) - Support expanded token usage variants (promptTokens, completionTokens, cache tokens) in Cursor Desktop - Parse and serialize token usage in Hermes harness message rows - Display session token accounting and assistant turn token counts in CLI view - Document token usage display in docs/usage.md - Add comprehensive integration tests in tests/integration/usage.rs
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.
Most harnesses track token usage in some form, but txcript previously dropped it during conversions, and xcript view didn't show any token statistics.
This PR wires up token tracking from the transcript model all the way through harnesses and into the terminal view.
What changed:
All tests pass and clippy runs clean.