feat: decompose the token "in" headline into fresh vs cached#9
Closed
wan-huiyan wants to merge 1 commit into
Closed
feat: decompose the token "in" headline into fresh vs cached#9wan-huiyan wants to merge 1 commit into
wan-huiyan wants to merge 1 commit into
Conversation
The "NN in" headline sums input + cache_read + cache_creation, which on a long multi-turn session is ~97% cheap cache_read — so a user sees an alarming "37M in / $80" without realizing almost none of it is freshly-billed input. Add an `Input X new · Y cached` line that splits freshly-billed input (input + cache_creation, at $15/M + $18.75/M) from cache reads ($1.50/M), so the cost line is interpretable. Single-session and live views; +2 tests. 89 pass.
This was referenced May 29, 2026
Author
|
Consolidated into #11 (token accounting: dedupe fallback + fresh-vs-cached). |
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.
Adds an
Input X new · Y cachedline splitting freshly-billed input (input + cache_creation) from cache reads (cache_read), so the cost line is interpretable when the "in" total is ~97% cheap cache reads. Single-session + live views; headline total unchanged. +2 tests; tsc clean.Supersedes #5 (which accidentally accumulated unrelated commits when fork-main was merged into its shared branch; re-created clean on a dedicated branch). 🤖 Generated with Claude Code