mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
When the Agent uses Gemini 3 Pro Preview, the error "Function call is missing a thought_signature in functionCall parts" occurs. #851
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gongshaojie12 on GitHub (Dec 3, 2025).
Self Checks
Dify version
1.10.0
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
Agent node
Agent strategy:FunctionCalling
Model:Gemini 3 Pro Preview
tools:nano banana pro image generation tool
Instruction: Call the tool to generate an image
When the following error occurs at runtime:
Run failed: Failed to transform agent message: req_id: 50a6e8171d PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: request failed: req_id: 0f6769f75e PluginInvokeError: {"args":{},"error_type":"ClientError","message":"400 INVALID_ARGUMENT. {'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:nano_banana_pro_g , position 2. Please refer to https://ai.google.dev/gemini-api/docs/thought-signatures for more details.', 'status': 'INVALID_ARGUMENT'}}"}"}When the model is switched to qwen-max, it runs normally.
✔️ Expected Behavior
When using the Gemini 3 Pro Preview model in the Agent, the tool can be called normally.
❌ Actual Behavior
In the Agent, the Gemini 3 Pro Preview model cannot call tools normally.
@dosubot[bot] commented on GitHub (Dec 3, 2025):
This error happens because Gemini 3 Pro Preview requires a special field called thought_signature in each function call for tool invocation, as described in the Gemini API docs. Dify's current implementation does not include this field when constructing function call payloads, which leads to the 400 INVALID_ARGUMENT error you see when using Gemini 3 Pro Preview with Agent tool calls. Other models like qwen-max work because they do not require this field for tool calls.
There is no official workaround or patch in Dify for this issue yet. Some users have suggested workarounds for related validation errors (like modifying the AgentModelConfig in the agent plugin), but there is no confirmed fix for the missing thought_signature with Gemini 3 Pro Preview. Upgrading the agent plugin may help with some function calling issues, but it is unclear if it resolves this specific problem. For now, using a model that does not require thought_signature (such as qwen-max or DeepSeek) is the only reliable way to enable tool calls in the Agent node with Dify.
References:
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
@dosubot[bot] commented on GitHub (Dec 3, 2025):
The error happens because Gemini 3 Pro Preview requires a thought_signature in function call parts, but the current Dify implementation does not include this field when constructing tool calls. The relevant code in Dify's Gemini integration uses types.Part.from_function_call with just the function name and arguments, omitting thought_signature, which leads to the 400 INVALID_ARGUMENT error from the Gemini API. This is not an issue with models like qwen-max, which do not require this parameter for tool calls. There are currently no merged pull requests or fixes addressing this in Dify, so tool calling with Gemini 3 Pro Preview is not supported until the implementation is updated to include thought_signature as required by the Gemini API. For now, using another model (like qwen-max) is the only workaround.
See implementation details
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
@hjlarry commented on GitHub (Dec 3, 2025):
please try gemini plugin 0.7.0