When the Agent uses Gemini 3 Pro Preview, the error "Function call is missing a thought_signature in functionCall parts" occurs. #851

Closed
opened 2026-02-16 10:20:43 -05:00 by yindo · 3 comments
Owner

Originally created by @gongshaojie12 on GitHub (Dec 3, 2025).

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

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.

Originally created by @gongshaojie12 on GitHub (Dec 3, 2025). ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### 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.
yindo added the bug label 2026-02-16 10:20:43 -05:00
yindo closed this issue 2026-02-16 10:20:43 -05:00
Author
Owner

@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

Chat with Dosu Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 3, 2025): <!-- Answer --> 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: - [Gemini API docs on thought_signature](https://ai.google.dev/gemini-api/docs/thought-signatures) - [Related Dify code analysis](https://github.com/langgenius/dify/blob/876f48df761d3a8e92b0d794942c16ff73e982d0/api/core/agent/fc_agent_runner.py) - [Community discussion and suggested workarounds](https://github.com/langgenius/dify/issues/14684) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/38b0fb87-acec-41cf-9910-a330d9708dc7?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/38b0fb87-acec-41cf-9910-a330d9708dc7?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/38b0fb87-acec-41cf-9910-a330d9708dc7?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/38b0fb87-acec-41cf-9910-a330d9708dc7?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/38b0fb87-acec-41cf-9910-a330d9708dc7?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/38b0fb87-acec-41cf-9910-a330d9708dc7?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/38b0fb87-acec-41cf-9910-a330d9708dc7?feedback_type=other)</sup> [![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=This%20error%20happens%20because%20Gemini%203%20Pro%20Preview%20requires%20a%20special%20field%20called%20thought_signature%20in%20each%20function%20call%20for%20tool%20invocation%2C%20as%20described%20in%20the%20Gemini%20API%20docs.%20Dify%27s%20current%20implementation%20does%20not%20include%20this%20field%20when%20constructing%20function%20call%20payloads%2C%20which%20leads%20to%20the%20400%20INVALID_ARGUMENT%20error%20you%20see%20when%20using%20Gemini%203%20Pro%20Preview%20with%20Agent%20tool%20calls.%20Other%20models%20like%20qwen-max%20work%20because%20they%20do%20not%20require%20this%20field%20for%20tool%20calls.%0A%0AThere%20is%20no%20official%20workaround%20or%20patch%20in%20Dify%20for%20this%20issue%20yet.%20Some%20users%20have%20suggested%20workarounds%20for%20related%20validation%20errors%20%28like%20modifying%20the%20AgentModelConfig%20in%20the%20agent%20plugin%29%2C%20but%20there%20is%20no%20confirmed%20fix%20for%20the%20missing%20thought_signature%20with%20Gemini%203%20Pro%20Preview.%20Upgrading%20the%20agent%20plugin%20may%20help%20with%20some%20function%20calling%20issues%2C%20but%20it%20is%20unclear%20if%20it%20resolves%20this%20specific%20problem.%20For%20now%2C%20using%20a%20model%20that%20does%20not%20require%20thought_signature%20%28such%20as%20qwen-max%20or%20DeepSeek%29%20is%20the%20only%20reliable%20way%20to%20enable%20tool%20calls%20in%20the%20Agent%20node%20with%20Dify.%0A%0AReferences%3A%20%20%0A-%20%5BGemini%20API%20docs%20on%20thought_signature%5D%28https%3A//ai.google.dev/gemini-api/docs/thought-signatures%29%20%20%0A-%20%5BRelated%20Dify%20code%20analysis%5D%28https%3A//github.com/langgenius/dify/blob/876f48df761d3a8e92b0d794942c16ff73e982d0/api/core/agent/fc_agent_runner.py%29%20%20%0A-%20%5BCommunity%20discussion%20and%20suggested%20workarounds%5D%28https%3A//github.com/langgenius/dify/issues/14684%29)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/29075)
Author
Owner

@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

Open in Cursor Join Discord Share on X

@dosubot[bot] commented on GitHub (Dec 3, 2025): <!-- Answer --> 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](https://github.com/langgenius/dify-official-plugins/blob/ce98548234e058990cb0e630b2204e8e243f49bf/models/gemini/models/llm/llm.py#L54-L1000) <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/944cc5aa-d96d-4411-ab7c-81c501ddbd1d?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/944cc5aa-d96d-4411-ab7c-81c501ddbd1d?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/944cc5aa-d96d-4411-ab7c-81c501ddbd1d?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/944cc5aa-d96d-4411-ab7c-81c501ddbd1d?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/944cc5aa-d96d-4411-ab7c-81c501ddbd1d?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/944cc5aa-d96d-4411-ab7c-81c501ddbd1d?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/944cc5aa-d96d-4411-ab7c-81c501ddbd1d?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20error%20happens%20because%20Gemini%203%20Pro%20Preview%20requires%20a%20thought_signature%20in%20function%20call%20parts%2C%20but%20the%20current%20Dify%20implementation%20does%20not%20include%20this%20field%20when%20constructing%20tool%20calls.%20The%20relevant%20code%20in%20Dify%27s%20Gemini%20integration%20uses%20types.Part.from_function_call%20with%20just%20the%20function%20name%20and%20arguments%2C%20omitting%20thought_signature%2C%20which%20leads%20to%20the%20400%20INVALID_ARGUMENT%20error%20from%20the%20Gemini%20API.%20This%20is%20not%20an%20issue%20with%20models%20like%20qwen-max%2C%20which%20do%20not%20require%20this%20parameter%20for%20tool%20calls.%20There%20are%20currently%20no%20merged%20pull%20requests%20or%20fixes%20addressing%20this%20in%20Dify%2C%20so%20tool%20calling%20with%20Gemini%203%20Pro%20Preview%20is%20not%20supported%20until%20the%20implementation%20is%20updated%20to%20include%20thought_signature%20as%20required%20by%20the%20Gemini%20API.%20For%20now%2C%20using%20another%20model%20%28like%20qwen-max%29%20is%20the%20only%20workaround.%20%20%0A%5BSee%20implementation%20details%5D%28https%3A//github.com/langgenius/dify-official-plugins/blob/ce98548234e058990cb0e630b2204e8e243f49bf/models/gemini/models/llm/llm.py%23L54-L1000%29)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify-official-plugins/issues/2168)
Author
Owner

@hjlarry commented on GitHub (Dec 3, 2025):

please try gemini plugin 0.7.0

@hjlarry commented on GitHub (Dec 3, 2025): please try gemini plugin 0.7.0
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#851