Skip to content

DeepSeek API: Missing 'thinking: disabled' parameter causes 400 error #15700

@ZHIJAC

Description

@ZHIJAC

Problem

When using DeepSeek API with Anthropic-compatible endpoint (https://api.deepseek.com/anthropic), Hermes fails with:

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

Root Cause

In agent/anthropic_adapter.py (line ~1659), when reasoning_config.enabled = False:

if reasoning_config.get("enabled") is not False and "haiku" not in model.lower():
    # sets thinking parameter

The code skips setting the thinking parameter when disabled, but DeepSeek API requires explicit thinking: {"type": "disabled"} to turn off thinking mode. Without this parameter, DeepSeek defaults to thinking mode enabled.

Expected Behavior

When reasoning_config.enabled = False, Hermes should send:

kwargs["thinking"] = {"type": "disabled"}

Workaround

Currently, users must either:

  1. Modify source code locally (lost on upgrade)
  2. Use OpenAI-compatible endpoint instead

Environment

  • Hermes Agent: latest (main branch)
  • Provider: DeepSeek API
  • Endpoint: https://api.deepseek.com/anthropic
  • Model: deepseek-v4-flash (and other DeepSeek models)

Related

DeepSeek API documentation: https://api-docs.deepseek.com/quick_start/pricing

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