mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-22 01:55:27 -04:00
deepseek-reasoner:Missing reasoning_content field in the assistant message at message index 2
#889
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 @leslie2046 on GitHub (Dec 21, 2025).
Self Checks
Dify version
1.11.1
Plugin version
0.0.7
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
✔️ 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_contentfield 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":"Missingreasoning_contentfield 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_contentfield 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":"Missingreasoning_contentfield 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"}}"}@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