Repository navigation
$ llm codec: cache-write and Cohere cached tokens bill at the input tier, as in 1.5.5 - #843
Draft
MattJackson wants to merge 1 commit into
Draft
MattJackson wants to merge 1 commit into
MattJackson wants to merge 1 commit into
Conversation
…ier, as in 1.5.5 The Chat and Responses readers split `cache_write_tokens` out of the input total onto the cache-write tier, and the Cohere reader split `cached_tokens` onto the cache-read tier. 1.5.5 billed both inside the input count (v1.5.5 crates/busbar/src/proto/openai_chat/reader.rs:693, :966; openai_responses/reader.rs:1022, :1341; cohere/reader.rs:709-729, :964-979 each set the split tier None). No owner ruling signs the move: the fidelity rule says "Billing never moves" and the 1.6.0 CHANGELOG says the token classes count exactly what 1.5.5 counted. The usage tables lose the split rows; the census, refusal and capture tests now pin 1.5.5's figures (RED before: input 60 / cache write 40 where 1.5.5 billed input 100).
MattJackson
marked this pull request as ready for review
October 14, 2026 00:55
Collaborator
Author
|
row 155 B2 (#974) edits crates/busbar-plane-llm/src/codec/{cohere,openai_chat,openai_responses}/mod.rs at fn claims and the DECL quota_exceeded_status / auth_failure_status_and_kind rows; disjoint from this PR's hunks. |
MattJackson
marked this pull request as draft
October 14, 2026 19:51
MattJackson
marked this pull request as ready for review
October 14, 2026 20:22
MattJackson
marked this pull request as draft
October 14, 2026 22:39
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. The OpenAI Chat and Responses readers moved
prompt_tokens_details.cache_write_tokens/input_tokens_details.cache_write_tokensout of the input total onto the cache-write tier, and the Cohere reader movedusage.cached_tokensonto the cache-read tier. This restores 1.5.5: both stay inside the input count and bill at the input tier.Why. Row-159 audit, plane-llm L3#2 (HIGH) and L2#4 (HIGH). 1.5.5 never split these: v1.5.5
crates/busbar/src/proto/openai_chat/reader.rs:693(stream) and:966(buffered),crates/busbar/src/proto/openai_responses/reader.rs:1022and:1341,crates/busbar/src/proto/cohere/reader.rs:709-729and:964-979each set the split tier toNone. Nothing signs the move. BUSBAR-1.6.0.md THE LLM DIALECT FIDELITY RULE says "Billing never moves". §7 Money and #77 say the money path stays 1.5.5's unless the owner signs a change, and #81 signs only fractional counts. CHANGELOG 1.6.0 Upgrade says "The token classes, their figures and everytokens:cap count exactly what 1.5.5 counted". LEDGER-100 is about adding units that were never ledgered. It does not cover these, because 1.5.5 already ledgered them, as input.RED-able tests (the expected figures come from the 1.5.5 lines above):
openai_chat/tests/unreadable_count_refusal_tests.rs::cache_write_tokens_bill_inside_the_input_on_every_pathandopenai_responses/...::cache_write_tokens_bill_inside_the_input_on_every_path: prompt 100, cache write 40 (also as"40"), output 9 ledgers input 100, output 9, no cache write, on the buffered, stream and truncated paths. Before this change: input 60 / cache write 40, and the string spelling was refused.usage_census_testsfor Chat and Responses classcache_write_tokensas a slice of the input. In the Cohere census,cached_tokensmoves nothing.codec/tests/cache_tier_capture_tests.rs: the three dialects' capture tests, rewritten against the recorded bodies to pin the 1.5.5 tiers.No ledger, oracle cell or ceiling changes. The oracle mock reports cache-write 0 and no Cohere
cached_tokens, so no recorded cell moves.