Skip to content

Bug: DeepSeek V4 Pro thinking content not persisted in session (HTTP 400 on multi-turn) #21944

@dada20260303

Description

@dada20260303

Bug Description

When using DeepSeek V4 Pro with thinking mode enabled, multi-turn conversations fail with:

HTTP 400: The content[].thinking in the thinking mode must be passed back to the API.

Root Cause

DeepSeek V4 Pro returns thinking content inside the content array:

{
  "choices": [{
    "message": {
      "content": [
        {"type": "thinking", "thinking": "..."},
        {"type": "output", "output": "..."}
      ]
    }
  }]
}

However, Hermes transport code only looks for reasoning_content field in the message object — it does not parse content array items with type: thinking.

Result: Thinking content is never saved to session. On the next turn, when the session is replayed, the thinking block is missing → DeepSeek API returns 400.

Reproduction

  1. Set up a profile with DeepSeek V4 Pro and thinking enabled
  2. Send a first message → succeeds, thinking appears in response
  3. Send a second message → fails with HTTP 400

Expected Behavior

Thinking content from content[].thinking should either:

  • Be persisted to session (so it is replayed in next turn), or
  • Be converted to reasoning_content field before session storage

Environment

  • Hermes v0.13.0 (v2026.5.7)
  • Provider: deepseek (DeepSeek V4 Pro)
  • OS: Linux (WSL)

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