deepseek-reasoner:Missing reasoning_content field in the assistant message at message index 2 #889

Closed
opened 2026-02-16 10:20:52 -05:00 by yindo · 1 comment
Owner

Originally created by @leslie2046 on GitHub (Dec 21, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.11.1

Plugin version

0.0.7

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

Image

✔️ Error log

Traceback (most recent call last):
File "/home/leslie/share/code/dify/api/core/app/apps/agent_chat/app_generator.py", line 243, in _generate_worker
runner.run(
File "/home/leslie/share/code/dify/api/core/app/apps/agent_chat/app_runner.py", line 234, in run
self._handle_invoke_result(
File "/home/leslie/share/code/dify/api/core/app/apps/base_app_runner.py", line 218, in _handle_invoke_result
self._handle_invoke_result_stream(invoke_result=invoke_result, queue_manager=queue_manager, agent=agent)
File "/home/leslie/share/code/dify/api/core/app/apps/base_app_runner.py", line 251, in _handle_invoke_result_stream
for result in invoke_result:
^^^^^^^^^^^^^
File "/home/leslie/share/code/dify/api/core/agent/fc_agent_runner.py", line 115, in run
for chunk in chunks:
^^^^^^
File "/home/leslie/share/code/dify/api/core/model_runtime/model_providers/__base/large_language_model.py", line 308, in _invoke_result_generator
raise self._transform_invoke_error(e)
File "/home/leslie/share/code/dify/api/core/model_runtime/model_providers/__base/large_language_model.py", line 277, in _invoke_result_generator
for chunk in result:
^^^^^^
File "/home/leslie/share/code/dify/api/core/plugin/impl/model.py", line 189, in invoke_llm
yield from response
File "/home/leslie/share/code/dify/api/core/plugin/impl/base.py", line 278, in _request_with_plugin_daemon_response_stream
self._handle_plugin_daemon_error(error.error_type, error.message)
File "/home/leslie/share/code/dify/api/core/plugin/impl/base.py", line 320, in _handle_plugin_daemon_error
raise PluginInvokeError(description=message)
core.plugin.impl.exc.PluginInvokeError: req_id: efe8b1ba9d 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_mode#tool-calls","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_mode#tool-calls","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}"}
2025-12-21 20:34:10,13 DEBUG [based_generate_task_pipeline.py:45] cbc9667aba error: req_id: cbc9667aba 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_mode#tool-calls","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_mode#tool-calls","type":"invalid_request_error","param":null,"code":"invalid_request_error"}}"}

Originally created by @leslie2046 on GitHub (Dec 21, 2025). ### Self Checks - [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 [Dify issues](https://github.com/langgenius/dify/issues) & [Dify Official Plugins](https://github.com/langgenius/dify-official-plugins/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.11.1 ### Plugin version 0.0.7 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce <img width="825" height="748" alt="Image" src="https://github.com/user-attachments/assets/5f34231d-c606-4226-945b-579131f017fa" /> ### ✔️ Error log Traceback (most recent call last): File "/home/leslie/share/code/dify/api/core/app/apps/agent_chat/app_generator.py", line 243, in _generate_worker runner.run( File "/home/leslie/share/code/dify/api/core/app/apps/agent_chat/app_runner.py", line 234, in run self._handle_invoke_result( File "/home/leslie/share/code/dify/api/core/app/apps/base_app_runner.py", line 218, in _handle_invoke_result self._handle_invoke_result_stream(invoke_result=invoke_result, queue_manager=queue_manager, agent=agent) File "/home/leslie/share/code/dify/api/core/app/apps/base_app_runner.py", line 251, in _handle_invoke_result_stream for result in invoke_result: ^^^^^^^^^^^^^ File "/home/leslie/share/code/dify/api/core/agent/fc_agent_runner.py", line 115, in run for chunk in chunks: ^^^^^^ File "/home/leslie/share/code/dify/api/core/model_runtime/model_providers/__base/large_language_model.py", line 308, in _invoke_result_generator raise self._transform_invoke_error(e) File "/home/leslie/share/code/dify/api/core/model_runtime/model_providers/__base/large_language_model.py", line 277, in _invoke_result_generator for chunk in result: ^^^^^^ File "/home/leslie/share/code/dify/api/core/plugin/impl/model.py", line 189, in invoke_llm yield from response File "/home/leslie/share/code/dify/api/core/plugin/impl/base.py", line 278, in _request_with_plugin_daemon_response_stream self._handle_plugin_daemon_error(error.error_type, error.message) File "/home/leslie/share/code/dify/api/core/plugin/impl/base.py", line 320, in _handle_plugin_daemon_error raise PluginInvokeError(description=message) core.plugin.impl.exc.PluginInvokeError: req_id: efe8b1ba9d 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_mode#tool-calls\",\"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_mode#tool-calls\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":\"invalid_request_error\"}}"} 2025-12-21 20:34:10,13 DEBUG [based_generate_task_pipeline.py:45] cbc9667aba error: req_id: cbc9667aba 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_mode#tool-calls\",\"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_mode#tool-calls\",\"type\":\"invalid_request_error\",\"param\":null,\"code\":\"invalid_request_error\"}}"}
yindo added the bug label 2026-02-16 10:20:52 -05:00
yindo closed this issue 2026-02-16 10:20:52 -05:00
Author
Owner

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

The error happens because DeepSeek Reasoner requires a reasoning_content field in assistant messages during thinking mode and tool calls, but previous versions of the plugin did not include it. This was fixed in a recent update: the plugin now extracts reasoning content from ... blocks in the assistant message and adds it as reasoning_content in the API request, which resolves the 400 error you’re seeing.

To fix this, upgrade your dify-official-plugins to a version that includes the fix (PR #2298, merged Dec 20, 2025). If you’re on plugin version 0.0.7, you’ll need to update to at least 0.0.37 or later, where this patch is present. You can see the details of the fix and how it works in the PR here.

After upgrading, both thinking mode and tool calls should work as expected with DeepSeek Reasoner. If you have custom code or run from source, you can manually apply the patch by ensuring reasoning_content is extracted and included as described in the PR. Let me know if you need help with the upgrade or patching process!

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 21, 2025): <!-- Answer --> The error happens because DeepSeek Reasoner requires a reasoning_content field in assistant messages during thinking mode and tool calls, but previous versions of the plugin did not include it. This was fixed in a recent update: the plugin now extracts reasoning content from <think>...</think> blocks in the assistant message and adds it as reasoning_content in the API request, which resolves the 400 error you’re seeing. To fix this, upgrade your dify-official-plugins to a version that includes the fix (PR #2298, merged Dec 20, 2025). If you’re on plugin version 0.0.7, you’ll need to update to at least 0.0.37 or later, where this patch is present. You can see the details of the fix and how it works in the [PR here](https://github.com/langgenius/dify-official-plugins/pull/2298). After upgrading, both thinking mode and tool calls should work as expected with DeepSeek Reasoner. If you have custom code or run from source, you can manually apply the patch by ensuring reasoning_content is extracted and included as described in the PR. Let me know if you need help with the upgrade or patching process! <!-- 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/dfa835ad-06d8-4c83-8b14-9fe6e0a7df7b?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/dfa835ad-06d8-4c83-8b14-9fe6e0a7df7b?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/dfa835ad-06d8-4c83-8b14-9fe6e0a7df7b?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/dfa835ad-06d8-4c83-8b14-9fe6e0a7df7b?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/dfa835ad-06d8-4c83-8b14-9fe6e0a7df7b?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/dfa835ad-06d8-4c83-8b14-9fe6e0a7df7b?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/dfa835ad-06d8-4c83-8b14-9fe6e0a7df7b?feedback_type=other)</sup> [![Open in Cursor](https://dosu.dev/dosu-in-cursor.svg)](https://cursor.com/link/prompt?text=The%20error%20happens%20because%20DeepSeek%20Reasoner%20requires%20a%20reasoning_content%20field%20in%20assistant%20messages%20during%20thinking%20mode%20and%20tool%20calls%2C%20but%20previous%20versions%20of%20the%20plugin%20did%20not%20include%20it.%20This%20was%20fixed%20in%20a%20recent%20update%3A%20the%20plugin%20now%20extracts%20reasoning%20content%20from%20%3Cthink%3E...%3C/think%3E%20blocks%20in%20the%20assistant%20message%20and%20adds%20it%20as%20reasoning_content%20in%20the%20API%20request%2C%20which%20resolves%20the%20400%20error%20you%E2%80%99re%20seeing.%20%0A%0ATo%20fix%20this%2C%20upgrade%20your%20dify-official-plugins%20to%20a%20version%20that%20includes%20the%20fix%20%28PR%20%232298%2C%20merged%20Dec%2020%2C%202025%29.%20If%20you%E2%80%99re%20on%20plugin%20version%200.0.7%2C%20you%E2%80%99ll%20need%20to%20update%20to%20at%20least%200.0.37%20or%20later%2C%20where%20this%20patch%20is%20present.%20You%20can%20see%20the%20details%20of%20the%20fix%20and%20how%20it%20works%20in%20the%20%5BPR%20here%5D%28https%3A//github.com/langgenius/dify-official-plugins/pull/2298%29.%0A%0AAfter%20upgrading%2C%20both%20thinking%20mode%20and%20tool%20calls%20should%20work%20as%20expected%20with%20DeepSeek%20Reasoner.%20If%20you%20have%20custom%20code%20or%20run%20from%20source%2C%20you%20can%20manually%20apply%20the%20patch%20by%20ensuring%20reasoning_content%20is%20extracted%20and%20included%20as%20described%20in%20the%20PR.%20Let%20me%20know%20if%20you%20need%20help%20with%20the%20upgrade%20or%20patching%20process%21)&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/2306)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify-official-plugins#889