hermes - 💡(How to fix) Fix [Bug]: DeepSeek API 400 error: "reasoning_content" in thinking mode must be passed back to the API [4 comments, 5 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#15717Fetched 2026-04-26 05:25:35
View on GitHub
Comments
4
Participants
5
Timeline
9
Reactions
1
Author
Timeline (top)
commented ×4labeled ×4cross-referenced ×1

Error Message

When using the DeepSeek provider with a model that supports thinking mode (e.g., deepseek-v4-flash), Hermes fails with an HTTP 400 error stating: 5.)Error appears: Error: HTTP 400: The 'reasoning_content' in the thinking mode must be passed back to the API. The API request should include any reasoning_content from previous assistant messages when the model is in thinking mode, allowing the conversation to proceed without error. The API request should include any reasoning_content from previous assistant messages when the model is in thinking mode, allowing the conversation to proceed without error.

Additional Logs / Traceback (optional)

Root Cause

Root Cause Analysis (optional)

Code Example



---
RAW_BUFFERClick to expand / collapse

Bug Description

When using the DeepSeek provider with a model that supports thinking mode (e.g., deepseek-v4-flash), Hermes fails with an HTTP 400 error stating:

The 'reasoning_content' in the thinking mode must be passed back to the API.

The API call should succeed and the assistant should respond normally, with Hermes correctly handling any reasoning_content returned by DeepSeek in subsequent requests.

<img width="1816" height="617" alt="Image" src="https://github.com/user-attachments/assets/8f1b9d32-a31e-46e9-9ba6-c8869e905f53" />

Steps to Reproduce

1.)Configure Hermes to use DeepSeek as the provider with model deepseek-v4-flash (thinking‑enabled model).

2.)Start a new chat session: hermes chat

3.)Send any message, e.g., "hi"

4.)The agent initializes and attempts an API call to DeepSeek.

5.)Error appears:

text API call failed (attempt 1/3): BadRequestError [HTTP 400] Provider: deepseek Model: deepseek-v4-flash Error: HTTP 400: The 'reasoning_content' in the thinking mode must be passed back to the API.

Expected Behavior

The API request should include any reasoning_content from previous assistant messages when the model is in thinking mode, allowing the conversation to proceed without error.

Actual Behavior

The API request should include any reasoning_content from previous assistant messages when the model is in thinking mode, allowing the conversation to proceed without error.

Affected Component

Agent Core (conversation loop, context compression, memory)

Messaging Platform (if gateway-related)

No response

Debug Report

Operating System

windows 11

Python Version

Python: 3.11.15

Hermes Version

Hermes Agent v0.11.0 (2026.4.23)

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

No response

Proposed Fix (optional)

No response

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

extent analysis

TL;DR

The issue can be resolved by modifying the API call to include the 'reasoning_content' from previous assistant messages when the model is in thinking mode.

Guidance

  • Verify that the 'reasoning_content' is being generated and stored correctly by the DeepSeek provider.
  • Check the Hermes code to ensure that it is properly handling and passing the 'reasoning_content' in the API call.
  • Review the conversation loop and context compression in the Agent Core component to identify where the 'reasoning_content' is being lost or not included in the API request.
  • Test the API call with a manual inclusion of the 'reasoning_content' to confirm that it resolves the HTTP 400 error.

Example

No code example can be provided without modifying the existing Hermes codebase, but the fix likely involves updating the API call to include the 'reasoning_content' parameter.

Notes

The exact fix will depend on the internal implementation of the Hermes Agent Core and its interaction with the DeepSeek provider. Further debugging and code review are necessary to identify the root cause and apply the correct fix.

Recommendation

Apply a workaround by manually including the 'reasoning_content' in the API call until a permanent fix can be implemented in the Hermes codebase.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: DeepSeek API 400 error: "reasoning_content" in thinking mode must be passed back to the API [4 comments, 5 participants]