Gemini 3.5 flash (gemini 3+ models) + Vertex AI + LiteLLM tool calling fails with invalid id fields after thought_signature fix #13259
Unanswered
spanda1985
asked this question in
Troubleshooting
Replies: 2 comments 1 reply
-
|
Remove the |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Use the latest version of LibreChat |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I am using LibreChat (v0.7.9)with LiteLLM as an external proxy and Vertex AI Gemini models.
Previously, with LiteLLM 1.79.x, tool calling failed due to missing thought_signature handling.
After upgrading LiteLLM to 1.87.0-dev.1, the original thought_signature error appears resolved, but now requests fail with a different Vertex AI validation error related to unsupported id fields inside function_call and function_response.
This appears to happen specifically during tool-calling/web-search flows.
The issue now looks like an OpenAI-style tool payload is leaking into the Vertex Gemini payload format.
Previous Error (LiteLLM 1.79.3)
Previously we consistently received:
Something went wrong. Here's the specific error message we encountered:
An error occurred while processing the request: 503 data:
{
"error": {
"message": "litellm.ServiceUnavailableError:
litellm.MidStreamFallbackError:
litellm.BadRequestError:
Vertex_ai_betaException BadRequestError - b'{
"error": {
"code": 400,
"message": "Unable to submit request because function call
default_api:web_searchin the 4. content block is missing athought_signature. Learn more: https://docs.cloud.google.com/vertex-ai/generative-ai/docs/thought-signatures\","status": "INVALID_ARGUMENT"
}
}'
Current Error (LiteLLM 1.87.0-dev.1)
After upgrading LiteLLM, the previous thought_signature error no longer occurs.
Now requests fail with:
Something went wrong. Here's the specific error message we encountered:
An error occurred while processing the request: 400
litellm.BadRequestError:
Vertex_ai_betaException BadRequestError - b'{
"error": {
"code": 400,
"message": "Invalid JSON payload received.
Unknown name "id" at 'contents[1].parts[1].function_call': Cannot find field.
Invalid JSON payload received.
Unknown name "id" at 'contents[2].parts[0].function_response': Cannot find field.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"field": "contents[1].parts[1].function_call",
"description": "Invalid JSON payload received. Unknown name "id" at 'contents[1].parts[1].function_call': Cannot find field."
},
{
"field": "contents[2].parts[0].function_response",
"description": "Invalid JSON payload received. Unknown name "id" at 'contents[2].parts[0].function_response': Cannot find field."
}
]
}
]
}
}'
Sample from gemini resp
LiteLLM:DEBUG[0m: vertex_and_google_ai_studio_gemini.py:3398 - RAW GEMINI CHUNK:
{ 'candidates': [{ 'content': { 'role': 'model', 'parts': [{ 'functionCall': { 'name': 'web_search', 'args': { 'news': True, 'query': 'latest news Europe May 2026' } }, 'thoughtSignature': 'AY89a1990/.......' }] } }], 'usageMetadata': { 'trafficType': 'ON_DEMAND' }, 'modelVersion': 'gemini-3.5-flash', 'createTime': '2026-05-22T00:23:38.013261Z', 'responseId': 'CqIPas1ntPXq2Q_OkYCwCA' }
From the repo i see that this might already been fixed.
If anyone can please help or point out to a patch/fix would really appreciate without upgrading to latest librechat.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions