Skip to content

Gemini API Error (400): Function call is missing a thought_signature #72127

@M00zyx

Description

@M00zyx

Describe the bug
The Google Generative AI API is returning a 400 INVALID_ARGUMENT error when making tool calls with Gemini models, specifically citing a missing thought_signature in the functionCall parts.

Error Message

{
  "error": {
    "code": 400,
    "message": "Function call is missing a thought_signature in functionCall parts. This is required for tools to work correctly, and missing thought_signature may lead to degraded model performance. Additional data, function call default_api:exec , position 75. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.",
    "status": "INVALID_ARGUMENT"
  }
}

Context

  • Model: Primarily observed with google/gemini-3.1-pro-preview, but likely affects other Gemini models.
  • Action: This error occurs consistently during tool calls (e.g., exec).
  • Environment: A clean, recent installation of OpenClaw.

Additional Information
A search of existing issues reveals this is a recurring problem with a long history (e.g., #71725, #63397, #58235, #34008). While many related issues are closed, the bug appears to have resurfaced or persists in certain configurations.

Previous attempts to live-patch compiled OpenClaw JavaScript files have been made in the past, but these are brittle workarounds that do not survive reinstalls. The issue seems more persistent with stricter models like Gemini Pro compared to Gemini Flash.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions