fix(interface): clarify cached vs new input token breakdown#692
Open
not-knope wants to merge 1 commit into
Open
fix(interface): clarify cached vs new input token breakdown#692not-knope wants to merge 1 commit into
not-knope wants to merge 1 commit into
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
Greptile SummaryThis PR clarifies how cached input tokens are shown in usage stats.
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(interface): clarify cached vs new in..." | Re-trigger Greptile |
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.
Closes #658
What changed
cached_tokens = 0, the cache row is still shown (Cached (in total) 0) so the sidebar metric remains visible during an active scan — same intent as before, with clearer labeling when cache is non-zero.tests/test_interface_stats.pywith three regression tests covering final stats, live-with-zero-cache, and live-with-cache breakdown.Why
Users could not tell whether cached tokens were included in the input total or additive (e.g. 20M input + 19M cached = 39M vs 20M with 19M cached). The new labels make the subset relationship explicit and surface the uncached count when caching is in use.
How I tested it
All 3 new tests pass.
I also ran the broader test suite locally. Pre-existing failures in
test_hooks.pyandtest_runner_rate_limit.pyare due to missingpytest-asyncioin the local environment (async tests are not collected/run correctly), not related to this change.Note
This PR was prepared with AI coding assistance (Cursor). All changes were reviewed, tested, and validated by the author before submission.