Repository navigation
Conversation
… leaves out at 5m An advisor pass, like the top level and a compaction pass, bills writes beyond its reported 5m and 1h counts at the 5m rate, and a split with only a 1h count no longer bills the whole total as 5m on top of it. The per-iteration usage details report the same split. One helper now reads an iteration's cache writes for all three. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
BenchmarksNo unaccepted regressions. 74 benchmarks: 0 regressed, 0 accepted, 0 improved, 0 new, 0 removed. All benchmarks
|
Contributor
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||
404oops
marked this pull request as ready for review
December 4, 2026 17:47
404oops
requested review from
ProgrammerIn-wonderland and
Salazareo
as code owners
December 4, 2026 17:47
This branch has not been deployed
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.
What changed
The executor's top level and, since #4873, a compaction pass bill cache writes that the reported lifetime split doesn't cover at the 5m rate. An advisor pass didn't:
cache_creation_input_tokensdropped the rest, so it was charged nowhere.ephemeral_1h_input_tokensbilled the whole total as 5m writes on top of the 1h writes, so the 1h tokens were charged twice.ClaudeProvidernow reads an iteration's cache writes through one helper,iterationCacheWrites, for advisor passes, compaction passes and the per-iteration entries inusageDetails.iterations. A full split and anullsplit bill as before.Anthropic's responses report full splits, so this changes nothing for a response shaped like the documented ones. Rates are unchanged.
Testing
ClaudeProvider.test.tsadds a three-row table for an advisor pass (no split, partial split, 1h only), checking the advisor's metered usage and the reported iteration. The partial and 1h-only rows fail on main. The Claude provider suites pass (289 tests). Lint, Prettier and typecheck pass. Benchmarks are left to CI. The change adds no I/O.🤖 Generated with Claude Code