HarmonyOS 鸿蒙Next中CodeGenie无法使用OpenCode Go套餐的模型

HarmonyOS 鸿蒙Next中CodeGenie无法使用OpenCode Go套餐的模型 通过URL添加的模型,使用时报错:

Error from provider (DeepSeek): The reasoning_content in the thinking mode must be passed back to the API.

详情见图片:

cke_769.png

cke_1907.png


更多关于HarmonyOS 鸿蒙Next中CodeGenie无法使用OpenCode Go套餐的模型的实战教程也可以访问 https://www.itying.com/category-93-b0.html

6 回复

开发者您好,当前通过 URL 方式添加的模型,暂不支持深度思考功能。您可通过服务商配置方式使用,参考文档:CodeGenie偶现报错:The reasoning_content in the thinking mode must be passed back to the API.

如果以上方案不能满足您的诉求,烦请您协助提供以下信息便于我们进一步上升处理:

请问您是在什么样的业务场景中使用该能力,交互流程是怎样的,在哪一个环节遇到了问题?方便说明能力不满足可能带来的影响:什么时间用到?是否高频?有无三方库可以做到?若提供该能力,是否会造成大工作量返工?请您注意提供的内容不要包含您或第三方的非公开信息,如给您带来不便,敬请谅解。

更多关于HarmonyOS 鸿蒙Next中CodeGenie无法使用OpenCode Go套餐的模型的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


这不是你配置错了,而是:

CodeGenie 当前对 DeepSeek V4 的 thinking/reasoning 模式兼容不完整

本质原因是:

DeepSeek V4 系列会返回 reasoning_content

而:

CodeGenie/OpenCode 没有在后续请求里正确回传 reasoning_content

于是 DeepSeek API 直接报:

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

这是 DeepSeek V4 Thinking Mode 的已知兼容问题。

你截图里的:

协议:OpenAI

其实只是:

OpenAI Compatible

但 DeepSeek V4 的 thinking mode 已经超出了标准 OpenAI chat 格式。

——

你现在这个:

https://opencode.ai/zen/go/v1
deepseek-v4-pro

实际上走的是:

OpenCode Go → DeepSeek V4 Pro

而:

builtin_read_file

这些 Tool Call/MCP 调用,

恰好又是最容易触发 reasoning_content 问题的场景。

所以:

第一次对话正常
第二次开始报错

是典型现象。

——

目前有 4 个解决方案。

方案1(最推荐)

换非 thinking 模型。

比如:

deepseek-v4-flash
deepseek-chat
deepseek-coder

不要用:

deepseek-v4-pro

或者:

reasoner

这种带 reasoning/thinking 的模型。

很多 Agent 框架现在都没完全兼容。

——

方案2

关闭 thinking mode。

如果 CodeGenie 支持额外参数,

加:

{
  "thinking": {
    "type": "disabled"
  }
}

DeepSeek 官方文档已经明确说明了这个机制。

但:

CodeGenie 大概率没有暴露这个配置

所以未必能改。

——

方案3

换 OpenAI 中转代理。

很多人现在会用:

  • LiteLLM
  • OneAPI
  • NewAPI
  • DeepSeek Compat Proxy

做一层“reasoning_content 自动回传”。

因为:

真正的问题不是 API Key
而是客户端没有保存 reasoning_content

——

方案4(最现实)

别用 URL 自定义。

直接:

通过服务商添加

因为很多平台会:

对 DeepSeek 做兼容处理

而:

通过URL添加

属于“裸 OpenAI 协议”,

CodeGenie 不会帮你做 DeepSeek 特殊字段处理。

——

还有一个关键点:

你这里:

https://opencode.ai/zen/go/v1

不是 DeepSeek 官方 API。

而是:

OpenCode Go 的聚合层

很多聚合平台:

  • OpenRouter
  • OpenCode
  • OneAPI
  • NewAPI

最近都在被 DeepSeek V4 的 reasoning_content 搞崩。

因为:

DeepSeek V4 的 thinking mode
不再是纯 OpenAI 兼容

官方文档已经特别强调:

tool_call 场景下
必须回传 reasoning_content

否则直接 400。

——

你现在最快的解决办法:

直接改模型:

deepseek-chat

或者:

deepseek-v4-flash

别用:

deepseek-v4-pro

尤其:

MCP
Tool Call
Agent
CodeGenie
OpenClaw
OpenCode
RooCode
Cline

这些场景。

好的 ,谢谢

楼主参考这个,不要用url添加,直接服务商配置,url目前好像不行: https://developer.huawei.com/consumer/cn/doc/harmonyos-faqs/faqs-codegenie-3

直接从服务商配置没问题,我知道

CodeGenie的OpenCode Go套餐模型专为Go语言设计,而鸿蒙Next开发默认不支持Go语言(需依赖第三方工具链),因此无法直接调用。当前CodeGenie仅适配ArkTS、C++等鸿蒙原生语言模型,该套餐的模型未集成至鸿蒙环境中。

回到顶部