You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[PR] test/fix(#7013): label prompt mass inside 'other' for google/responses wire shapes (stacked on #7092) - #7118
Stacked on #7092 — do not merge before it lands. Base here is that PR's head branch (2026-11-18_rcagg-doom-gate-pricing-mismatch), not master; once #7092 merges I'll retarget this to master.
Why
#7092 prices the window-fit gates off breakdown.prompt (PROMPT_BODY_KEYS), but breakdown.other is bucketed by the ANTHROPIC key names (messages / tools / system / everything-else). google carries its prompt in contents/systemInstruction and responses in input/instructions — none of them is an anthropic bucket name, so that mass lands in other while ALSO being the prompt number that trips the gate. The measured-doom 413 then says:
messages ~0 · tools[] ~0 · system ~0 · other ~1,200,008 (non-prompt, excluded from the window budget; top field: contents ~1,200,001 tokens ≈3,600,004 B)
…i.e. it names the supposedly-EXCLUDED bucket as the reason the body was refused.
What
src/preflight.ts: RawBodyBreakdown gains otherPrompt — the part of other that is still prompt mass for the wire format. Accumulated at the same string leaf as prompt, so the two can never drift.
src/server.ts: measuredBreakdownClause splits other on it: other ~1,201,100 (prompt mass ~1,200,009 counted toward the window, 1,091 excluded as non-prompt; top field: contents …)
When otherPrompt === 0 (anthropic/openai, where other really is transport like dsh_session_log) the previous wording is byte-identical.
tests/issue7013-prompt-mass-google-responses.test.ts (new, 6 cases): attribution + clause wording for google/responses, anthropic/openai controls, measuredOutbound prompt-mass pricing across all four protocols.
tests/raw-body-walk-depth.test.ts: one whole-object expectation gains otherPrompt: 0.
ranxianglei
changed the title
test/fix(#7013): label prompt mass inside 'other' for google/responses wire shapes (stacked on #7092)
[PR] test/fix(#7013): label prompt mass inside 'other' for google/responses wire shapes (stacked on #7092)
Nov 18, 2026
This PR is superseded by ccfee8ad on the base branch ("align the breakdown's named buckets with the prompt mass on every lane", #7090), which solves the same symptom the right way.
My patch added an otherPrompt sub-total plus a clause wording split, so the 413 message could explain that part of other was actually prompt mass. The base branch instead fixes the bucket assignment itself (PROMPT_KEY_BUCKET: input/contents → messages, systemInstruction/instructions → system), which makes prompt === messages + tools + system and prompt + other === total hold on every lane by construction.
With that in place the otherPrompt branch would be dead code (other can no longer contain prompt mass), and the added tests asserting prompt keys land in other would now fail — so this branch is redundant rather than worth rebasing. Closing it to avoid stacking a conflicting change.
For the record: the prompt-mass clause assertions on the google/responses lanes and the four-protocol measuredOutbound check are the parts still worth having; they are covered by the base branch tests now, so if a gap shows up this can come back as a test-only PR. Thanks!
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
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.
Stacked on #7092 — do not merge before it lands. Base here is that PR's head branch (
2026-11-18_rcagg-doom-gate-pricing-mismatch), not master; once #7092 merges I'll retarget this to master.Why
#7092 prices the window-fit gates off
breakdown.prompt(PROMPT_BODY_KEYS), butbreakdown.otheris bucketed by the ANTHROPIC key names (messages / tools / system / everything-else). google carries its prompt incontents/systemInstructionand responses ininput/instructions— none of them is an anthropic bucket name, so that mass lands inotherwhile ALSO being thepromptnumber that trips the gate. The measured-doom 413 then says:…i.e. it names the supposedly-EXCLUDED bucket as the reason the body was refused.
What
src/preflight.ts:RawBodyBreakdowngainsotherPrompt— the part ofotherthat is still prompt mass for the wire format. Accumulated at the same string leaf asprompt, so the two can never drift.src/server.ts:measuredBreakdownClausesplitsotheron it:other ~1,201,100 (prompt mass ~1,200,009 counted toward the window, 1,091 excluded as non-prompt; top field: contents …)When
otherPrompt === 0(anthropic/openai, whereotherreally is transport likedsh_session_log) the previous wording is byte-identical.tests/issue7013-prompt-mass-google-responses.test.ts(new, 6 cases): attribution + clause wording for google/responses, anthropic/openai controls,measuredOutboundprompt-mass pricing across all four protocols.tests/raw-body-walk-depth.test.ts: one whole-object expectation gainsotherPrompt: 0.Verification
The new assertions fail on the parent branch and pass with the patch (red first).