[Gemini 3 Flash Preview] Inconsistent thought_signature generation in parallel function calls causes 400 errors and potential silent data loss – Gemini API


Summary

Gemini 3 Flash Preview (gemini-3-flash-preview) exhibits a critical bug where it inconsistently generates thought_signature fields for parallel function calls. This causes:

  1. 400 INVALID_ARGUMENT errors when returning function results
  2. Position-based, non-deterministic signature generation
  3. Makes Gemini 3 Flash unsuitable for production use with multi-tool scenarios

Environment

  • Model: gemini-3-flash-preview
  • API: Vertex AI (Node.js SDK)
  • Region: global
  • SDK: @google/genai v1.38.0
  • Date Tested: January 23, 2026
  • Baseline: Same code works flawlessly with gemini-2.5-flash

Expected Behavior

According to official documentation:

“If you use the official SDKs and standard chat history, thought signatures are handled automatically for you.”

When Gemini 3 Flash returns multiple parallel function calls, all function calls should include thought_signature fields, allowing the client to return function results successfully.


Actual Behavior

Gemini 3 Flash Preview inconsistently generates thought_signature fields in multi-tool responses:

  • Only the first 1-2 function calls receive signatures
  • Remaining function calls have NO signature field (hasThoughtSignatureField: false)
  • The cutoff point is non-deterministic (varies between requests)
  • Subsequent API requests fail with: 400: INVALID_ARGUMENT - "Unable to submit request because function call in the X. content block is missing a thought_signature"

Evidence from Testing

We implemented comprehensive debug logging that captures the raw API response directly from Google’s SDK, proving this is an API-level bug, not a client implementation issue.

Test Case 1: User request requiring 3 data retrieval operations

Prompt: User asks for comprehensive report requiring multiple data sources

Google’s Raw Response (3 parallel tool calls):

{
  "toolCalls": [
    {
      "toolName": "get_resource_list",
      "hasThoughtSignatureField": true,
      "thoughtSignatureValue": "CiEBjz1rX0ilumvPg6k0sMMUtISoQCLJv2bPJ7Vv9r+Xw0o=",
      "thoughtSignatureLength": 48
    },
    {
      "toolName": "get_detailed_results", 
      "hasThoughtSignatureField": true,
      "thoughtSignatureValue": "CiEBjz1rX0ilumvPg6k0sMMUtISoQCLJv2bPJ7Vv9r+Xw0o=",
      "thoughtSignatureLength": 48
    },
    {
      "toolName": "analyze_data",
      "hasThoughtSignatureField": false,
      "thoughtSignatureValue": undefined
    }
  ]
}

Result: :white_check_mark: Position 1-2 have signatures | :cross_mark: Position 3 missing → 400 error when returning position 3 result

Error Message:

Unable to submit request because function call `analyze_data` 
in the 6. content block is missing a `thought_signature`.

Test Case 2: User request with explicit sequential operations

Prompt: User explicitly requests multiple operations in sequence

Google’s Raw Response (3 parallel tool calls):

{
  "toolCalls": [
    {
      "toolName": "analyze_data",
      "hasThoughtSignatureField": true,
      "thoughtSignatureValue": "CiEBjz1rX0ilumvPg6k0sMMUtISoQCLJv2bPJ7Vv9r+Xw0o=",
      "thoughtSignatureLength": 48
    },
    {
      "toolName": "get_detailed_results",
      "hasThoughtSignatureField": false,
      "thoughtSignatureValue": undefined
    },
    {
      "toolName": "get_resource_list",
      "hasThoughtSignatureField": false,
      "thoughtSignatureValue": undefined
    }
  ]
}

Result: :white_check_mark: Position 1 has signature | :cross_mark: Position 2-3 missing → 400 error when returning position 2 result

Error Message:

Unable to submit request because function call `get_detailed_results` 
in the 4. content block is missing a `thought_signature`.

Key Finding: Position-Based, Not Tool-Specific

Critical observation: The tool get_resource_list:

  • :white_check_mark: HAD signature in Test Case 1 (position 1)
  • :cross_mark: NO signature in Test Case 2 (position 3)

This proves the bug is position-based, not related to specific tools.


Pattern Summary

Test Total Tools Signatures Provided by Google Failed On
1 3 Position 1-2 only Position 3
2 3 Position 1 only Position 2

Conclusion: Gemini 3 Flash generates signatures for approximately the first 1-2 tool calls, then stops. The cutoff is non-deterministic.


Impact Assessment

Severity: CRITICAL

  • Scope: Any application using Gemini 3 Flash with 3+ parallel function calls
  • Frequency: Occurs consistently when 3+ tools are called in parallel
  • Reliability: Non-deterministic cutoff makes it impossible to predict which calls will fail
  • Production Impact: Cannot reliably use Gemini 3 Flash for multi-tool scenarios

Reproduction Steps

  1. Configure Vertex AI with gemini-3-flash-preview model (global region)
  2. Define 3 or more tool/function declarations
  3. Send a prompt that triggers 3+ parallel function calls
  4. Capture raw API response from generateContentStream
  5. Observe: Only first 1-2 tool calls will have thought_signature field
  6. Return all tool results (with signatures where provided)
  7. Observe: 400 INVALID_ARGUMENT error for tool calls missing signatures

Our Implementation (Verified Correct)

To rule out implementation issues, we:

:white_check_mark: Properly capture thought signatures from streaming responses
:white_check_mark: Correctly preserve signatures through tool execution lifecycle
:white_check_mark: Accurately return signatures byte-for-byte to the API
:white_check_mark: Added extensive debug logging at every step of the flow
:white_check_mark: Confirmed with raw API response logs that Google simply doesn’t send signatures for all tool calls

The same implementation works flawlessly with Gemini 2.5 Flash, proving this is a Gemini 3 API issue.


Debug Logs (Server-Side)

Evidence from our production logs showing the raw Google response:

[llm] 2026-01-23 16:19:40 [debug]: [RAW GOOGLE RESPONSE] Tool call received
{"toolName":"analyze_data","hasThoughtSignatureField":true,
 "thoughtSignatureValue":"CiEBjz1rX0ilumvPg6k0sMMUtISoQCLJv2bPJ7Vv9r+Xw0o="}

[llm] 2026-01-23 16:19:40 [debug]: [RAW GOOGLE RESPONSE] Tool call received
{"toolName":"get_detailed_results","hasThoughtSignatureField":false}

[llm] 2026-01-23 16:19:41 [debug]: [RAW GOOGLE RESPONSE] Tool call received
{"toolName":"get_resource_list","hasThoughtSignatureField":false}

These logs capture the response directly from the SDK, before any application processing.


Workaround

Use gemini-2.5-flash instead.

This model:

  • :white_check_mark: Doesn’t use thought signatures
  • :white_check_mark: Handles parallel function calls reliably
  • :white_check_mark: Produces consistent, predictable results

Questions for Google

  1. Why are thought signatures inconsistently generated for parallel function calls?
  2. Is this a known limitation of the preview API?
  3. What is the intended maximum number of parallel function calls with thought signatures?
  4. Is there a timeline for fixing this in Gemini 3 Flash?
  5. Should Gemini 3 Flash be considered production-ready for function calling scenarios?

Request

Please fix Gemini 3 Flash Preview to consistently generate thought_signature for ALL function calls in a parallel response, or clearly document any limitations on the number of parallel tool calls supported.


Contact & Additional Evidence

We have extensive debug logs, raw API responses, and reproduction code available. Happy to provide additional evidence or collaborate on debugging.

Environment: Enterprise production system with comprehensive monitoring and logging infrastructure.


This bug makes Gemini 3 Flash unsuitable for production use with multi-tool function calling. We’re staying on Gemini 2.5 Flash until this is resolved.



Source link

Leave a Reply

Your email address will not be published. Required fields are marked *