Agent node Error:Missing reasoning_content field in the assistant message, #20715

Open
opened 2026-02-21 20:08:36 -05:00 by yindo · 6 comments
Owner

Originally created by @wfeixu on GitHub (Dec 1, 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.9.0

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When the agent use Function calling, the node will report:
Failed to transform agent message: req_id: 9270178e61 PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: request failed: [deepseek] Error: req_id: 1e5dc97030 PluginInvokeError: {"args":{"description":"[models] Error: API request failed with status code 400: {\"error\":{\"message\":\"Missing reasoning_content field in the assistant message at message index 2. For more information, please refer to https://api-docs.deepseek.com/guides/thinking_with_tools\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":\"invalid_request_error\"}}"},"error_type":"InvokeError","message":"[models] Error: API request failed with status code 400: {\"error\":{\"message\":\"Missing reasoning_content field in the assistant message at message index 2. For more information, please refer to https://api-docs.deepseek.com/guides/thinking_with_tools\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":\"invalid_request_error\"}}"}"}

✔️ Expected Behavior

Should work normal.

Actual Behavior

Maybe related to the update of Deepseek V3.2 today.

Originally created by @wfeixu on GitHub (Dec 1, 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.9.0 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When the agent use Function calling, the node will report: Failed to transform agent message: req_id: 9270178e61 PluginInvokeError: {"args":{},"error_type":"Exception","message":"read llm model failed: request failed: [deepseek] Error: req_id: 1e5dc97030 PluginInvokeError: {\"args\":{\"description\":\"[models] Error: API request failed with status code 400: {\\\"error\\\":{\\\"message\\\":\\\"Missing `reasoning_content` field in the assistant message at message index 2. For more information, please refer to https://api-docs.deepseek.com/guides/thinking_with_tools\\\",\\\"type\\\":\\\"invalid_request_error\\\",\\\"param\\\":null,\\\"code\\\":\\\"invalid_request_error\\\"}}\"},\"error_type\":\"InvokeError\",\"message\":\"[models] Error: API request failed with status code 400: {\\\"error\\\":{\\\"message\\\":\\\"Missing `reasoning_content` field in the assistant message at message index 2. For more information, please refer to https://api-docs.deepseek.com/guides/thinking_with_tools\\\",\\\"type\\\":\\\"invalid_request_error\\\",\\\"param\\\":null,\\\"code\\\":\\\"invalid_request_error\\\"}}\"}"} ### ✔️ Expected Behavior Should work normal. ### ❌ Actual Behavior Maybe related to the update of Deepseek V3.2 today.
yindo added the 🤖 feat:agentstale labels 2026-02-21 20:08:36 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Dec 1, 2025):

This error is caused by a breaking change in Deepseek V3.2: the API now requires a reasoning_content field in each assistant message when using tool/function calling. Dify 1.9.0 does not include this field in the payload, so Deepseek returns a 400 error. This is a known compatibility issue—there are no merged fixes or official workarounds yet, and the community has been actively requesting support for this field and separation of reasoning content from main content, especially for streaming and TTS scenarios (discussion, feature request).

Simply adding an empty or duplicated reasoning_content field is not enough; it must be correctly extracted and formatted from the model output. Implementing a patch would require updating the agent message construction logic to extract reasoning content (often from <think> tags or a dedicated field) and include it in the assistant message payload sent to Deepseek (Deepseek API docs).

Partial workarounds are limited: you could try downgrading Deepseek to a version before V3.2, use a different model provider, or avoid function calling with Deepseek until Dify adds support. For now, keep an eye on the main GitHub issues and consider contributing or testing future patches if you need this feature urgently.

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 1, 2025): <!-- Answer --> This error is caused by a breaking change in Deepseek V3.2: the API now requires a `reasoning_content` field in each assistant message when using tool/function calling. Dify 1.9.0 does not include this field in the payload, so Deepseek returns a 400 error. This is a known compatibility issue—there are no merged fixes or official workarounds yet, and the community has been actively requesting support for this field and separation of reasoning content from main content, especially for streaming and TTS scenarios ([discussion](https://github.com/langgenius/dify/issues/14270#issuecomment-2689489252), [feature request](https://github.com/langgenius/dify/issues/12891)). Simply adding an empty or duplicated `reasoning_content` field is not enough; it must be correctly extracted and formatted from the model output. Implementing a patch would require updating the agent message construction logic to extract reasoning content (often from `<think>` tags or a dedicated field) and include it in the assistant message payload sent to Deepseek ([Deepseek API docs](https://api-docs.deepseek.com/guides/thinking_with_tools)). Partial workarounds are limited: you could try downgrading Deepseek to a version before V3.2, use a different model provider, or avoid function calling with Deepseek until Dify adds support. For now, keep an eye on the main GitHub issues and consider contributing or testing future patches if you need this feature urgently. <!-- 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/5c61844f-9521-4cb6-b697-f0ead0686e8c?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/5c61844f-9521-4cb6-b697-f0ead0686e8c?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/5c61844f-9521-4cb6-b697-f0ead0686e8c?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/5c61844f-9521-4cb6-b697-f0ead0686e8c?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/5c61844f-9521-4cb6-b697-f0ead0686e8c?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/5c61844f-9521-4cb6-b697-f0ead0686e8c?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/5c61844f-9521-4cb6-b697-f0ead0686e8c?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%20is%20caused%20by%20a%20breaking%20change%20in%20Deepseek%20V3.2%3A%20the%20API%20now%20requires%20a%20%60reasoning_content%60%20field%20in%20each%20assistant%20message%20when%20using%20tool/function%20calling.%20Dify%201.9.0%20does%20not%20include%20this%20field%20in%20the%20payload%2C%20so%20Deepseek%20returns%20a%20400%20error.%20This%20is%20a%20known%20compatibility%20issue%E2%80%94there%20are%20no%20merged%20fixes%20or%20official%20workarounds%20yet%2C%20and%20the%20community%20has%20been%20actively%20requesting%20support%20for%20this%20field%20and%20separation%20of%20reasoning%20content%20from%20main%20content%2C%20especially%20for%20streaming%20and%20TTS%20scenarios%20%28%5Bdiscussion%5D%28https%3A//github.com/langgenius/dify/issues/14270%23issuecomment-2689489252%29%2C%20%5Bfeature%20request%5D%28https%3A//github.com/langgenius/dify/issues/12891%29%29.%0A%0ASimply%20adding%20an%20empty%20or%20duplicated%20%60reasoning_content%60%20field%20is%20not%20enough%3B%20it%20must%20be%20correctly%20extracted%20and%20formatted%20from%20the%20model%20output.%20Implementing%20a%20patch%20would%20require%20updating%20the%20agent%20message%20construction%20logic%20to%20extract%20reasoning%20content%20%28often%20from%20%60%3Cthink%3E%60%20tags%20or%20a%20dedicated%20field%29%20and%20include%20it%20in%20the%20assistant%20message%20payload%20sent%20to%20Deepseek%20%28%5BDeepseek%20API%20docs%5D%28https%3A//api-docs.deepseek.com/guides/thinking_with_tools%29%29.%0A%0APartial%20workarounds%20are%20limited%3A%20you%20could%20try%20downgrading%20Deepseek%20to%20a%20version%20before%20V3.2%2C%20use%20a%20different%20model%20provider%2C%20or%20avoid%20function%20calling%20with%20Deepseek%20until%20Dify%20adds%20support.%20For%20now%2C%20keep%20an%20eye%20on%20the%20main%20GitHub%20issues%20and%20consider%20contributing%20or%20testing%20future%20patches%20if%20you%20need%20this%20feature%20urgently.)&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/28988)
Author
Owner

@DepengZou commented on GitHub (Dec 4, 2025):

I also encountered the same issue.

@DepengZou commented on GitHub (Dec 4, 2025): I also encountered the same issue.
Author
Owner

@fanfan-lucky commented on GitHub (Dec 18, 2025):

Has this issue been resolved? @dosu

@fanfan-lucky commented on GitHub (Dec 18, 2025): Has this issue been resolved? @dosu
Author
Owner

@dosubot[bot] commented on GitHub (Jan 19, 2026):

Hi, @wfeixu. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a 400 error in Dify 1.9.0 when using Function calling with the Deepseek model due to a missing reasoning_content field.
  • This is caused by a breaking change in Deepseek V3.2 requiring reasoning_content in assistant messages.
  • Currently, Dify does not extract or include this field, so the issue remains unresolved.
  • Workarounds include downgrading Deepseek, using other providers, or avoiding function calling.
  • Other users have confirmed the problem, but no fix has been implemented yet.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of Dify by commenting here to keep the discussion open.
  • Otherwise, this issue will be automatically closed in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Jan 19, 2026): Hi, @wfeixu. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a 400 error in Dify 1.9.0 when using Function calling with the Deepseek model due to a missing `reasoning_content` field. - This is caused by a breaking change in Deepseek V3.2 requiring `reasoning_content` in assistant messages. - Currently, Dify does not extract or include this field, so the issue remains unresolved. - Workarounds include downgrading Deepseek, using other providers, or avoiding function calling. - Other users have confirmed the problem, but no fix has been implemented yet. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of Dify by commenting here to keep the discussion open. - Otherwise, this issue will be automatically closed in 15 days. Thank you for your understanding and contribution!
Author
Owner

@fanfan-lucky commented on GitHub (Jan 21, 2026):

If I use plugin "deepseek" model provider, can this "reasoning content" issue be resolved? @dosu

@fanfan-lucky commented on GitHub (Jan 21, 2026): If I use plugin "deepseek" model provider, can this "reasoning content" issue be resolved? @dosu
Author
Owner

@dosubot[bot] commented on GitHub (Feb 21, 2026):

Hi, @wfeixu. I'm Dosu, and I'm helping the Dify team manage their backlog and am marking this issue as stale.

Issue Summary:

  • You reported a 400 error in Dify 1.9.0 when using Function calling with Deepseek due to a missing reasoning_content field required by Deepseek V3.2.
  • This is a known compatibility issue because Dify does not yet extract or include the reasoning_content field in assistant messages.
  • Workarounds include downgrading Deepseek, using other providers, or avoiding function calling.
  • Other users have confirmed the issue, and no fix has been implemented yet.

Next Steps:

  • Please let me know if this issue is still relevant with the latest version of Dify by commenting here to keep the discussion open.
  • Otherwise, I will automatically close this issue in 15 days.

Thank you for your understanding and contribution!

@dosubot[bot] commented on GitHub (Feb 21, 2026): Hi, @wfeixu. I'm [Dosu](https://dosu.dev), and I'm helping the Dify team manage their backlog and am marking this issue as stale. **Issue Summary:** - You reported a 400 error in Dify 1.9.0 when using Function calling with Deepseek due to a missing `reasoning_content` field required by Deepseek V3.2. - This is a known compatibility issue because Dify does not yet extract or include the `reasoning_content` field in assistant messages. - Workarounds include downgrading Deepseek, using other providers, or avoiding function calling. - Other users have confirmed the issue, and no fix has been implemented yet. **Next Steps:** - Please let me know if this issue is still relevant with the latest version of Dify by commenting here to keep the discussion open. - Otherwise, I will automatically close this issue in 15 days. Thank you for your understanding and contribution!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#20715