Skip to content

$ llm codec: a Gemini transcription answer bills its token fields only, as in 1.5.5 - #858

Merged
MattJackson merged 1 commit into
predevfrom
lane-llm-billing-duration
Oct 15, 2026
Merged

MattJackson merged 1 commit into
predevfrom
lane-llm-billing-duration

Conversation

@MattJackson

Copy link
Copy Markdown
Collaborator

What. read_transcription_response (Gemini) billed an upstream-sent usageMetadata.audioDurationSeconds as Billing::Duration, the audio_ms class, in place of the token fields. An upstream could therefore choose the meter by sending a member that Gemini's UsageMetadata does not define. The reader now reads only promptTokenCount/candidatesTokenCount, as 1.5.5 did.

Why. Row-159 plane-llm L3#9, the reader half; the writer half is in #857, which is not $. The 1.5.5 source is v1.5.5 crates/busbar/src/handlers/gemini.rs:229-241. The fidelity rule says "Billing never moves", and no register entry covers this.

RED-able test. gemini/tests/handler_tests.rs::transcription_response_reads_no_audio_duration_member: {"usageMetadata":{"audioDurationSeconds":12.5}} reads as Tokens{0,0} (1.5.5), not Duration{12.5}. It replaces the round-trip test that pinned the 1.6.0 reading.

No ledger, oracle cell or ceiling changes.

…y, as in 1.5.5

The reader billed an upstream-sent usageMetadata.audioDurationSeconds as Billing::Duration
(the audio_ms class), so an upstream could pick the meter by sending a member Gemini does not
define. 1.5.5 read only promptTokenCount/candidatesTokenCount (v1.5.5
crates/busbar/src/handlers/gemini.rs:229-241). Row-159 plane-llm L3#9, reader half.
@MattJackson MattJackson added the alone ModernCI: judge and land alone (never batched) label Oct 14, 2026
@MattJackson
MattJackson marked this pull request as ready for review October 14, 2026 20:22
@MattJackson
MattJackson marked this pull request as draft October 14, 2026 22:39
@MattJackson
MattJackson merged commit 0c4c077 into predev Oct 15, 2026
1 check was pending
@MattJackson
MattJackson deleted the lane-llm-billing-duration branch October 15, 2026 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

alone ModernCI: judge and land alone (never batched)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant