Bug Description
When using DeepSeek v4 series models (deepseek-v4-pro) with thinking mode enabled, multi-turn conversations with tool calls intermittently fail with HTTP 400: The reasoning_content in the thinking mode must be passed back to the API.
Root Cause
In multi-turn tool-calling scenarios, Hermes sometimes fails to include reasoning_content in assistant messages when constructing subsequent requests.
Evidence from request dumps:
-
Direct hit (Session 20260429_175349_88d049, Apr 29 18:14):
- Message [40]: assistant + tool_calls + reasoning_content ✓
- Message [42]: assistant + tool_calls + reasoning_content ✓
- Message [44]: assistant + tool_calls WITHOUT reasoning_content ✗ ← causes 400
-
Null reasoning_content (Session 20260428_160911_013162, Apr 28 16:09):
- Message [133]: assistant with
reasoning_content: null
The pattern: all other models (qwen3.6-plus, kimi-k2.6, etc.) work fine because they don't enforce reasoning_content echo-back. Only DeepSeek enforces this requirement in thinking mode.
Steps to Reproduce
- Configure Hermes with
deepseek-v4-pro via an OpenAI-compatible endpoint (e.g., OpenCode Go API at opencode.ai/zen/go/v1)
- Enable thinking mode (the model defaults to
xhigh)
- Have a multi-turn conversation with multiple tool calls (5+ rounds of tool usage)
- Eventually the 400 error appears when Hermes sends a request missing
reasoning_content in an assistant message
Expected Behavior
All assistant messages (especially those with tool_calls) that the API returned with reasoning_content should have that field preserved when echoed back in subsequent requests.
Actual Behavior
Some assistant messages lose their reasoning_content field. The API then rejects the request with:
Error code: 400 - {'error': {'message': 'Error from provider (DeepSeek): The reasoning_content in the thinking mode must be passed back to the API.'}}
Configuration
model:
default: deepseek-v4-pro
provider: go-custom
base_url: https://opencode.ai/zen/go/v1
compression:
enabled: true
threshold: 0.5
target_ratio: 0.2
protect_last_n: 20
Related
Logs
2026-04-29 18:03:42,992 ERROR root: Non-retryable client error: Error code: 400 - {'error': {'message': 'Error from provider (DeepSeek): The reasoning_content in the thinking mode must be passed back to the API.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_request_error'}}
2026-04-29 18:14:10,896 ERROR root: Non-retryable client error: Error code: 400 - {'error': {'message': 'Error from provider (DeepSeek): The reasoning_content in the thinking mode must be passed back to the API.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_request_error'}}
Full request dumps available at ~/.hermes/sessions/request_dump_*_deepseek*.json
Bug Description
When using DeepSeek v4 series models (deepseek-v4-pro) with thinking mode enabled, multi-turn conversations with tool calls intermittently fail with HTTP 400:
The reasoning_content in the thinking mode must be passed back to the API.Root Cause
In multi-turn tool-calling scenarios, Hermes sometimes fails to include
reasoning_contentin assistant messages when constructing subsequent requests.Evidence from request dumps:
Direct hit (Session
20260429_175349_88d049, Apr 29 18:14):Null reasoning_content (Session
20260428_160911_013162, Apr 28 16:09):reasoning_content: nullThe pattern: all other models (qwen3.6-plus, kimi-k2.6, etc.) work fine because they don't enforce
reasoning_contentecho-back. Only DeepSeek enforces this requirement in thinking mode.Steps to Reproduce
deepseek-v4-provia an OpenAI-compatible endpoint (e.g., OpenCode Go API atopencode.ai/zen/go/v1)xhigh)reasoning_contentin an assistant messageExpected Behavior
All assistant messages (especially those with
tool_calls) that the API returned withreasoning_contentshould have that field preserved when echoed back in subsequent requests.Actual Behavior
Some assistant messages lose their
reasoning_contentfield. The API then rejects the request with:Configuration
Related
reasoning_content导致报错 router-for-me/CLIProxyAPI#2999 (closed, same symptom, different root cause)Logs
Full request dumps available at
~/.hermes/sessions/request_dump_*_deepseek*.json