[v6.0] fix: prevent warnings and skip-validator injection for valid Gemini 3 parallel function calls - #17745
Conversation
Bugfix reviewOutcome: approved Fixes issueStatus: fully-addresses The converter now recognizes a signed standard function call as covering subsequent unsigned parallel function calls in the same assistant response, while resetting state between responses, excluding server-tool calls from seeding it, and retaining mitigation for genuinely missing first signatures. Side effectsRisk: low The behavior change is narrowly limited to Gemini 3 unsigned standard function calls following a signed standard call in the same model response; non-Gemini models, separate assistant responses, server-tool-only signatures, and genuinely unsigned batches retain existing behavior. PerformanceRisk: none The implementation adds one response-local boolean and constant-time checks per tool-call part, with no additional collections, I/O, or asymptotic cost. Backwards compatibilityRisk: low No stored data is mutated or migrated. Existing persisted signed-first/unsigned-later parallel responses are serialized more faithfully, while genuinely missing first signatures still receive the fallback sentinel and warning. ArchitectureRisk: none The logic remains localized in the Google provider's message converter, which owns Gemini wire-format serialization and is already shared with Vertex through declared package dependencies and exports; no cross-package source imports or new coupling were introduced. Change scopeStatus: minimal All three changed files are necessary: the localized converter fix, focused regression coverage, and the required patch changeset. No unrelated abstractions, dependencies, generated artifacts, or production changes were added. SecurityRisk: none The change introduces no new input parsing, credential handling, network access, dynamic execution, or trust-boundary changes. TestingStatus: appropriate Regression tests cover three parallel calls, intervening text and server parts, server signatures not seeding standard-call state, namespace resolution, and preservation of the genuine missing-signature fallback. VerificationInspected the complete merge-base diff and relevant converter call paths, compared the backport with the upstream fix, confirmed a clean diff, and verified the Google Node and Edge suites passed with 570 tests each. Package type checking and focused formatting/lint checks also passed. Relevant Documentation |
|
🚀 Published in:
|
Background
Gemini 3 legitimately signs only the first standard function call in a parallel model response, but replaying later unsigned calls caused misleading warnings and unnecessary skip-validator injection.
Root Cause
The Google converter evaluated missing signatures per normalized tool-call part rather than recognizing that one assistant message represents a model response whose first standard parallel function call carries the shared signature.
Summary
The converter now tracks signed standard function calls across the entire assistant response, preserves state across mixed parts, excludes built-in server calls from seeding that state, retains fallback mitigation for genuinely missing signatures, and includes a patch changeset.
Testing
Regression coverage verifies three-call parallel responses, intervening text and server parts, signed-server/unsigned-function behavior, genuine missing-signature fallback, and provider namespace handling. Google Node and Edge suites, full workspace type checking, and focused formatting/lint checks pass.
End-to-end Validation
pnpm -C packages/google build && pnpm -C examples/ai-functions exec tsx src/stream-text/google/function-call-id.ts— live Gemini calls produced three parallel tool calls and completed replay with final text.pnpm -C examples/ai-functions exec tsx -e '<inline Gemini 3.5 Flash parallel-call probe>'— observed[signed,unsigned,unsigned], an empty warnings array, and successful final text generation.Related Issues
Fixes #16298
Closes #17620
Backport of #17649
Co-authored-by: mttzzz 16290052+mttzzz@users.noreply.github.com
Co-authored-by: lgrammel 205036+lgrammel@users.noreply.github.com