fix(segments): hide the cold-cache marker when writes are never metered - #55
Merged
Merged
Conversation
The statusline payload's rate_limits.spend_limit grew used_usd, limit_usd and period, emitted behind gateways with a USD-denominated overage limit. Pin the field names so the drift test passes on 2.1.288 and bump the pinned-version comment to match. Parsing is left out: spend_limit only appears on gateway accounts, and the credits segment covers spend only on the mac_insecure path, so gateway users get no display either way until someone asks for it. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>
Providers with automatic server-side caching (kimi) report cache reads but never a write, so the harness's TTL clock is the only thing that ever flips warm to false: the ice marker fires on plain idle time with no recache cost existing to warn about. Suppress the segment when the session reports cache_write_tokens as a pinned zero; an absent or null field (older harness) keeps the marker. Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>
… writes Assisted-by: LLM Signed-off-by: Aleksei Sviridkin <f@lex.la>
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.
The cold-cache marker warns about a recache cost: a cold prefix is re-processed on the next request. Providers with automatic server-side caching report cache reads but never meter a write, so that cost does not exist there — yet the marker still fires on every idle period, because the harness flips
warmon its own TTL clock regardless.The segment now stays hidden when the session reports
cache_write_tokensas a pinned zero. An absent or null field (older harness) keeps the marker, so Anthropic behavior is unchanged.Trade-off, stated openly: an Anthropic session that never wrote a single cache token (e.g. a resumed session whose only requests were full read hits) would also keep a zero count and lose a cold marker that is real. Every normal turn writes its new suffix, so this stays theoretical.
Also pinned: three new
rate_limits.spend_limitfields (used_usd,limit_usd,period) from the 2.1.288 binary, so the schema-drift test passes on it. They are gateway-only and unparsed.