Skip to content

BUG: DeepSeek API 400 error — reasoning_content in thinking mode must be passed back #3579

@fyc09

Description

@fyc09

What happened?

When using Qwen Code with DeepSeek's API (deepseek-v4-flash model, base URL https://api.deepseek.com/v1), the following error occurs intermittently during conversation:

✕ [API Error: 400 The reasoning_content in the thinking mode must be passed back to the API.]

This happens when DeepSeek's reasoning model returns a reasoning_content field in its response, and Qwen Code fails to pass it back in subsequent API requests. DeepSeek's API requires that reasoning_content from the assistant's response be included in the messages array for follow-up requests when thinking mode is active.

What did you expect to happen?

The conversation should continue normally without API errors. Qwen Code should properly preserve and pass back the reasoning_content field from the assistant's response when making subsequent API calls to DeepSeek's API.

Client information

Client Information ``` Qwen Code 0.15.1 (9010c09) 运行环境 Node.js v22.18.0 / npm 11.10.0 IDE 客户端 VS Code 操作系统 win32 x64 (10.0.26200) 认证 API Key - openai 基础 URL https://api.deepseek.com/v1 模型 deepseek-v4-flash 快速模型 deepseek-v4-flash 沙箱 no sandbox 代理 no proxy 内存使用 261.1 MB ```

Login information

Using API Key authentication with OpenAI-compatible provider pointing to DeepSeek API:

  • Provider type: openai
  • Base URL: https://api.deepseek.com/v1
  • Model ID: deepseek-v4-flash (custom provider config)

Anything else we need to know?

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions