openclaw - 💡(How to fix) Fix [Bug]: Gemini API error (400): missing `thought_signature` [4 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#74244Fetched 2026-04-30 06:26:48
View on GitHub
Comments
4
Participants
2
Timeline
13
Reactions
2
Timeline (top)
commented ×4cross-referenced ×2labeled ×2mentioned ×2

Sustaining chain of thought after tool call hangs up randomly, due to missing thought_signature in the api call succeeding the tool output

Error Message

Google Generative AI API error (400): 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 `def… [code=INVALID_ARGUMENT] Although this sounds like its optional - its not, its a full fledge no response error.

Root Cause

Sustaining chain of thought after tool call hangs up randomly, due to missing thought_signature in the api call succeeding the tool output

Code Example

Google Generative AI API error (400): 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 `def… [code=INVALID_ARGUMENT]

Although this sounds like its optional - its not, its a full fledge no response error.
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

Sustaining chain of thought after tool call hangs up randomly, due to missing thought_signature in the api call succeeding the tool output

Steps to reproduce

Not fully deterministic as this is not a hard enforcing from google point of view, docs: Though Signature

  1. Open 2026.4.26 opneclaw
  2. Setup Gemini API key (AI studio) and use thinking models (order of this commonly occuring 3.1 Pro > 2.5 Pro > Flash)
  3. Run some multistep tool usage prompt (asking the main agents to spawn subagents for the task has >70% failure rate and the subagents simply not respond back due to this silent failure). My usage is mostly in physics research.

Expected behavior

Sustain chain of though agentic workflows smoothly.

Actual behavior

Random silent failure in chain of though agentic workflows.

OpenClaw version

2026.4.26

Operating system

Ubuntu 24.04.4 LTS

Install method

npm [email protected] (later update to 2026.4.26)

Model

Gemini

Provider / routing chain

openclaw -> Google API

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Google Generative AI API error (400): 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 `def… [code=INVALID_ARGUMENT]

Although this sounds like its optional - its not, its a full fledge no response error.

Impact and severity

Affected: Gemini API Models Severity: Blocks any agentic workflows Frequency: intermittent Consequence: No response / complete stall

Additional information

Fix suggestion:

Following the Vertex AI docs

  • The fix should be as simple as storing the thought_signature of the output before the tool using and attaching it to the API call after the tool usage (that contain the tool outputs).

Thank you!

extent analysis

TL;DR

The most likely fix is to store the thought_signature of the output before the tool usage and attach it to the API call after the tool usage.

Guidance

  • Review the Vertex AI documentation on Thought Signatures to understand the requirements for thought_signature in API calls.
  • Modify the code to store the thought_signature of the output before the tool usage and attach it to the API call after the tool usage, as suggested in the fix suggestion.
  • Verify that the thought_signature is being correctly stored and attached to the API call by checking the API request payload.
  • Test the modified code with the Gemini API models to ensure that the chain of thought agentic workflows is sustained smoothly.

Example

No code snippet is provided as the issue does not include specific code details.

Notes

The fix may require modifications to the OpenClaw code to store and attach the thought_signature to the API call. The Vertex AI documentation should be consulted to ensure that the thought_signature is being used correctly.

Recommendation

Apply the workaround by modifying the code to store and attach the thought_signature to the API call, as this is the suggested fix and is supported by the Vertex AI documentation.

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…

FAQ

Expected behavior

Sustain chain of though agentic workflows smoothly.

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 [Bug]: Gemini API error (400): missing `thought_signature` [4 comments, 2 participants]