fix: noisy Gemini 3 parallel tool-call replay warnings when only the first call in a batch has a thought signature#16986
fix: noisy Gemini 3 parallel tool-call replay warnings when only the first call in a batch has a thought signature#16986lgrammel wants to merge 4 commits into
Conversation
|
Test and verify with 3 parallel tool calls. |
|
Addressed PR comment 4924897879.
Expanded the converter regression and reproduction script from two to three parallel |
|
In the end-to-end-verification, test that things work in multi-step roundtrips, i.e. when there are tool results for 3 parallel calls and the another llm request (e.g. via setting stopWhen: to like 5 steps) |
|
Addressed PR comment 4924897879.
The converter regression and reproduction remain expanded to three parallel |
|
Addressed PR comment 4925008508.
Confirmed. I kept the three parallel-call coverage in place and built on it by asserting the live run includes matching tool results and final text from the subsequent model request. |
|
Addressed PR comment 4925319502.
Updated the reproduction to use |
Bugfix reviewOutcome: approved Fixes issueStatus: fully-addresses The PR directly fixes the reported noisy Gemini 3 parallel tool-call replay path: Concerns: none. Side effectsRisk: low The behavior change is narrowly scoped to Gemini 3 missing-thoughtSignature mitigation for later tool calls in the same contiguous assistant tool-call batch; standalone or fully unsigned tool calls still inject the sentinel and warn as before. Concerns: none. PerformanceRisk: low The implementation adds only a boolean flag while mapping assistant content parts, with no meaningful memory or runtime overhead. Concerns: none. Backwards compatibilityRisk: low No stored data is mutated. Replayed stored transcripts with one signed parallel call followed by unsigned calls now serialize without the sentinel for the unsigned calls, which is the intended fix; fully missing-signature transcripts retain the prior mitigation. Concerns: none. SecurityRisk: none The change does not add new parsing, network access, persistence, or trust boundaries; it only changes whether a documented sentinel string is added to selected Gemini 3 tool-call parts. Concerns: none. TestingStatus: appropriate The PR adds a focused regression test for a Gemini 3 batch with three parallel tool calls where only the first has a thoughtSignature, and existing tests still cover missing-signature sentinel injection and warning behavior. Concerns: none. VerificationInspected |
Background
Gemini 3 parallel tool-call replays can legitimately include one signed function call followed by unsigned calls, but the converter treated each unsigned call as dropped metadata and emitted noisy skip-signature warnings.
Summary
The Google message converter now tracks contiguous assistant tool-call batches and skips the Gemini 3 missing-signature sentinel for unsigned calls that follow a real signed call in the same batch.
Testing
Updated the focused converter regression to cover a signed-first/unsigned-second Gemini 3 parallel tool-call batch without relying on the reproduction fixture, and updated the reproduction example to assert the fixed no-warning outcome.
End-to-end Validation
Example examples/ai-functions/src/reproduction/issue-16298-gemini3-parallel-tool-calls.ts; live API command pnpm -C examples/ai-functions exec tsx src/reproduction/issue-16298-gemini3-parallel-tool-calls.ts; observed two parallel get_weather calls with one present thought signature, one absent thought signature, WARNINGS: [], and fixed: true.
Related Issues
Fixes #16298
Co-authored-by: mttzzz 16290052+mttzzz@users.noreply.github.com
Co-authored-by: lgrammel 205036+lgrammel@users.noreply.github.com