What this error means
Gemini 2.5 returns 400 INVALID_ARGUMENT when a functionCall part is replayed without the thought_signature it originally issued.
How to fix it
- Preserve thought_signature on every functionCall part you send back
- Keep function turns immediately after the matching user or tool turn
- Do not hand-edit or truncate prior tool messages
Example error message
{
"error": {
"code": 400,
"message": "Function call is missing a thought_signature in functionCall parts.",
"status": "INVALID_ARGUMENT"
}
}Frequently asked
Why did this start after upgrading to Gemini 2.5?
Thought signatures are new to 2.5 thinking models; older clients that strip unknown fields drop them and trigger the 400.