Skip to content

[Bug]: DeepSeek V4 via OpenRouter fails on follow-up/tool turns with reasoning_content error because DeepSeek wrapper only applies to provider=deepseek #76018

Description

@cloph-dsp

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

When using deepseek/deepseek-v4-flash through OpenRouter in OpenClaw, follow-up turns can fail with:

code: 20015
The reasoning_content in the thinking mode must be passed back to the API.

This appears to happen because OpenClaw's DeepSeek-specific handling for reasoning_content only activates for provider = "deepseek", not for OpenRouter-routed DeepSeek models. As a result, the conversation history is not normalized/replayed in the way DeepSeek expects on subsequent turns. [docs mention special handling for DeepSeek V4 models in the native DeepSeek provider path.]

Steps to reproduce

  1. Configure OpenClaw to use OpenRouter
  2. Set model to deepseek/deepseek-v4-flash
  3. Start a conversation
  4. Send an initial prompt
  5. Send a follow-up prompt, or trigger a tool call and then continue the conversation
  6. Observe upstream failure with error 20015

Expected behavior

OpenClaw should detect DeepSeek V4 models even when routed through OpenRouter and apply the same normalization/replay behavior as the native DeepSeek provider path, including handling of reasoning_content across follow-up and tool-call turns.

At minimum, OpenClaw should not break multi-turn conversations for OpenRouter-routed DeepSeek V4 models that require reasoning continuity.

Actual behavior

  • Model: deepseek/deepseek-v4-flash via OpenRouter
  • Provider in config: openrouter
  • OpenClaw works on the first turn, but follow-up turns and especially tool-call flows may fail
  • Error returned by upstream:
    • code: 20015
    • The reasoning_content in the thinking mode must be passed back to the API.

In practice:

  • if the model emits reasoning_content, DeepSeek expects that content to be echoed/replayed correctly on subsequent requests
  • OpenClaw seems to do the right thing only for native provider=deepseek
  • for provider=openrouter, the DeepSeek V4 wrapper/path does not seem to run, so the request format/history becomes inconsistent for DeepSeek

OpenClaw version

2026.4.29

Operating system

debian 12.1

Install method

No response

Model

deepseek-v4-flash

Provider / routing chain

openrouter, various providers

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregressionBehavior that previously worked and now fails

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions