Skip to content

[Bug]: DeepSeek API 400 error: "reasoning_content" in thinking mode must be passed back to the API #15717

@bnicer

Description

@bnicer

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.

Image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/agentCore agent loop, run_agent.py, prompt builderprovider/deepseekDeepSeek APItype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions