openclaw - 💡(How to fix) Fix Gemini API Error (400): Function call is missing a thought_signature [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#72127Fetched 2026-04-27 05:34:28
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Author
Timeline (top)
closed ×1commented ×1

Error Message

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": {

  • Action: This error occurs consistently during tool calls (e.g., exec).

Fix Action

Fix / Workaround

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.

Code Example

{
  "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"
  }
}
RAW_BUFFERClick to expand / collapse

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.

extent analysis

TL;DR

The most likely fix is to include a thought_signature in the functionCall parts of the API request to the Google Generative AI API when using Gemini models.

Guidance

  • Review the API documentation at https://ai.google.dev/gemini-api/docs/thought-signatures to understand the required format and content of the thought_signature.
  • Verify that the functionCall parts of the API request include the required thought_signature field.
  • Check the OpenClaw documentation to see if there are any configuration options or updates that can help resolve the issue.
  • Consider reaching out to the Google Generative AI API support team or the OpenClaw community for further assistance, as this issue has a history of recurring problems.

Example

No code snippet is provided as the issue does not include specific code examples, and generating one could introduce inaccuracies.

Notes

The issue seems to be model-specific, with stricter models like Gemini Pro being more prone to this error. The problem has a history of recurring, and previous workarounds may not be reliable.

Recommendation

Apply a workaround by including the required thought_signature in the API request, as the root cause appears to be a missing field rather than a versioning issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Gemini API Error (400): Function call is missing a thought_signature [1 comments, 2 participants]