Repository navigation
test(drift): accept gemini-3.5-flash-lite wire on the live Gemini legs - #660
Merged
Merged
Conversation
Diagnostic only, reverted in a follow-up commit. Repeats the live Gemini requests behind the tests that started failing on 2026-12-01 and writes the raw native responses, plus each failing test's error messages, into key-free drift-evidence files that the drift-live-pr head artifact keeps.
commit: |
Diagnostic only, reverted with the probe. Takes more samples of the GenerateContent and Interactions K9 streams, which vary between calls.
Since 2026-12-01 Google serves gemini-2.5-flash requests with
gemini-3.5-flash-lite (modelVersion and interaction.model say so). Its
streams differ in ways the live legs read too strictly:
- A streamed tool call ends with a separate { text: "" } STOP chunk, so
the tool-call shape check now compares the chunk that carries the
functionCall instead of the last chunk.
- A K5 object that produced nothing has "content": {} with no parts;
the modeled reader reads absent parts as empty.
- MAX_TOKENS streams end with an empty text part holding only a
thoughtSignature; the native modeled comparison drops it.
- Interactions thought steps close with one thought_signature delta,
interaction.created has no id or status, and the K9 stream sometimes
answers with no thought summary. The live native leg accepts exactly
these shapes; captured references and localhost stay strict.
Real captures and mutations pin each accepted and rejected shape.
jpr5
marked this pull request as ready for review
December 3, 2026 22:43
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 happened
The nightly Drift Tests have failed on Gemini since the Dec 1 run (46822766380, 10:11 PM PST) and again on Dec 2 (47048242663). The last good run was 46588624835 (Nov 30). No aimock code changed in between.
The cause is on Google's side. Requests for
gemini-2.5-flashare now served bygemini-3.5-flash-lite. Every live response we captured says so:"modelVersion": "gemini-3.5-flash-lite"on GenerateContent, and"model": "gemini-3.5-flash-lite"on Interactions events. The October captures in these tests saygemini-2.5-flash. The new model streams a few things differently, and five live tests read those streams too strictly.This PR only changes the two Gemini drift test files. The mock is not changed (reasoning below).
Each failing test
gemini.drift.tsstreaming tool call shape matches[critical] LLMOCK DRIFT ... candidates[].content.parts[].text(mock hasfunctionCall)idandthoughtSignature) comes in one chunk. Then a separate last chunk carriesparts: [{"text": ""}]andfinishReason: "STOP". Seen in 10/10 calls, with and withouttoolConfigmode ANY, so forcing the tool does not help.gemini.drift.tslive boundedstop-length-mid-toolstream=falseInvalid Gemini content"content": {}, no parts and no role, withMAX_TOKENS(3/3 calls)gemini.drift.tslive boundedreasoning-onlystream=true (5 of 6 nightly attempts)"text": ""and athoughtSignature. When the model only thought (1/13 probe calls), the stream is[thought part]then[{text: "", thoughtSignature}] MAX_TOKENS. That counts as triggered, then fails the thought-only check on the empty part.gemini-interactions.drift.ts'K9 stream' matches native and localhostexpected 'thought_signature' to be 'thought_summary'thought_signaturedelta right beforestep.stop(8/11 calls). In the other 3/11 calls the thought step holds only that signature, and an answer step follows (1-6 text deltas,total_output_tokens2).malformed_tool_calloutcome. Captured references and localhost stay strict.gemini-interactions.drift.tslive modeled K5 streamexpected undefined to be 'in_progress'interaction.creatednow has onlyobjectandmodel, with noidand nostatus. The thought step's only delta is athought_signature(3/3 calls).in_progress), and a signature delta is accepted in a thought step. Localhost still must sendin_progress. The outcome is NOT_TRIGGERED, as it was before.The Anthropic and Gemini native-auth differences are unchanged. They are the already-approved policy set.
Why the mock is not changed
The mock's chunks are still valid streams that clients read the same way. The new-model extras (a separate empty STOP chunk, signature deltas, a created event without id or status) are either metadata or model-specific. Older models, and the non-streaming tool call that still passes, keep the old shape. Changing the mock would change every Gemini streaming replay to match one aliased model. One open question for later: Gemini 3 models expect
thoughtSignatureto be sent back in multi-turn tool calls, and aimock does not emit signatures. That is a separate feature question and is not part of this fix.Evidence
There are no provider keys locally, so the live probe ran in CI, following the #636 pattern. Commit
95fe7834added a temporary probe that repeated each live request and wrote the raw native responses. It also added a hook that wrote each failing test's error message, into key-freedrift-evidence/files in the drift-live-pr head artifact. Commitfa34a9b9took more samples. Commit881f088dreverted both, with no force-push. The artifacts were scanned for key material, and none was found.RED
Google Geminicrit=1. The head capture recorded the failure messages in the table above.Raw excerpts (signatures shortened):
GREEN (head
506f5c7e)Google Geminientry.driftjob via workflow_dispatch on this branch, run 47218965022 (2:35 PM PST): success, with the same results. The report holds only the approved native-auth criticals.Offline pins. Real captures from the runs above, pinned by sha256, plus mutations: the K5
content: {}, the K9 thought plus empty-signature stream, the Interactions K9 signed and summary-less streams, and the K5 stream. Each accepted shape compares. Each mutation (non-array parts, a non-empty answer part, a STOP terminal, a completed status, a wrong token total, an empty signature, a wrong created status) still fails. When the fixes are reverted locally, these 4 new tests fail.Local:
vitest --config vitest.config.drift.ts src/__tests__/drift/gemini56 passed, 20 skipped (no key).tsc -p tsconfig.test.jsonclean. eslint and prettier clean on both files. Nosrc/code changed, so there is no CHANGELOG entry.🤖 Generated with Claude Code
https://claude.ai/code/session_01Jay9vBCbXhVHCDgyRBABVx