Skip to content

deepseek v4 pro开启前思考模式的时候api层丢弃reasoning_content导致接口调用失败 #24714

@maoxinxu

Description

@maoxinxu

Description

OpenCode Go 代理在收到 Hermes 发来的完整请求后,构建给 DeepSeek 的请求时只保留了 OpenAI Chat Completions 标准字段(`role`, `content`, `tool_calls` 等),把非标准的 `reasoning_content` 过滤掉了,进而导致了api接口报错。

Plugins

hermes + opencode go

OpenCode version

使用的opencode go订阅,不是opencode cli

Steps to reproduce

  1. 安装hermes agent
  2. 接口opencode go,选择deepseek v4 pro
  3. 开始对话,对话几轮后会突然开始失败了,返回如下内容,之后除非切换其他模型否这再也无法正常调用
⚠️  API call failed (attempt 1/3): BadRequestError [HTTP 400]
   🔌 Provider: opencode-go  Model: deepseek-v4-pro
   🌐 Endpoint: https://opencode.ai/zen/go/v1
   📝 Error: HTTP 400: Error from provider (DeepSeek): The `reasoning_content` in the thinking mode must be passed back to the API.
   📋 Details: {'message': 'Error from provider (DeepSeek): The `reasoning_content` in the thinking mode must be passed back to the API.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_request_error'}
⚠️ Non-retryable error (HTTP 400) — trying fallback...
❌ Non-retryable error (HTTP 400): HTTP 400: Error from provider (DeepSeek): The `reasoning_content` in the thinking mode must be passed back to the API.
❌ Non-retryable client error (HTTP 400). Aborting.
   🔌 Provider: opencode-go  Model: deepseek-v4-pro
   🌐 Endpoint: https://opencode.ai/zen/go/v1
   💡 This type of error won't be fixed by retrying.

Screenshot and/or share link

Image

Operating System

$ cat /etc/os-release
PRETTY_NAME="Ubuntu 24.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04.4 LTS (Noble Numbat)"
VERSION_CODENAME=noble
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=noble
LOGO=ubuntu-logo

Terminal

ubuntu自带的terminal

Metadata

Metadata

Assignees

Labels

No labels
No labels

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