[GH-ISSUE #193] Claude Code 启用子agent处理任务时,API 报错 "thinking options type cannot be disabled when reasoning_effort is set" #68

Closed
opened 2026-10-26 09:44:53 +00:00 by bsakaguchi · 16 comments
Owner

Originally created by @TaoZhengCN on GitHub (Jun 6, 2026).
Original GitHub issue: https://github.com/deepseek-ai/awesome-deepseek-agent/issues/193

如题,经初步排查是 claude code cli 硬编码导致启动子 agent 的时候会同时传参:{"thinking": {"type": "disabled"}} 和 {"output_config": {"effort": "max"}}, deepseek api 接收到会报错。

Originally created by @TaoZhengCN on GitHub (Jun 6, 2026). Original GitHub issue: https://github.com/deepseek-ai/awesome-deepseek-agent/issues/193 如题,经初步排查是 claude code cli 硬编码导致启动子 agent 的时候会同时传参:{"thinking": {"type": "disabled"}} 和 {"output_config": {"effort": "max"}}, deepseek api 接收到会报错。
Author
Owner

@wangzhzzzzzz commented on GitHub (Jun 6, 2026):

claude code cli使用websearch功能也有这个问题 "API Error: 400 thinking options type cannot be disabled when reasoning_effort is set"

<!-- gh-comment-id:4637825763 --> @wangzhzzzzzz commented on GitHub (Jun 6, 2026): claude code cli使用websearch功能也有这个问题 "API Error: 400 thinking options type cannot be disabled when reasoning_effort is set"
Author
Owner

@weidong commented on GitHub (Jun 8, 2026):

+1,遇到了完全相同的问题。Claude Code 2.1.168 + DeepSeek API。

复现验证

通过 curl 确认了根因:

✅ 这个组合正常工作

{"model":"deepseek-v4-pro","thinking":{"type":"disabled"}}

❌ 这个组合触发 400 错误

{"model":"deepseek-v4-pro","thinking":{"type":"disabled"},"output_config":{"effort":"max"}
}

→ "thinking options type cannot be disabled when reasoning_effort is set"

关键是 output_config 字段,不是顶层的 reasoning_effort。
如果改用顶层 reasoning_effort(不带 output_config),
deepseek-v4-pro 也能正常接受 thinking: disabled。

尝试过的配置(均无效)

  • CLAUDE_CODE_SUBAGENT_MODEL=deepseek-v4-flash
  • MAX_THINKING_TOKENS=16000
  • 移除 CLAUDE_CODE_EFFORT_LEVEL
  • 移除 [1m] 模型后缀
  • CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1

确认是 Claude Code CLI 硬编码行为,无法从配置层面绕过。

<!-- gh-comment-id:4646997182 --> @weidong commented on GitHub (Jun 8, 2026): +1,遇到了完全相同的问题。Claude Code 2.1.168 + DeepSeek API。 ## 复现验证 通过 curl 确认了根因: # ✅ 这个组合正常工作 {"model":"deepseek-v4-pro","thinking":{"type":"disabled"}} # ❌ 这个组合触发 400 错误 {"model":"deepseek-v4-pro","thinking":{"type":"disabled"},"output_config":{"effort":"max"} } # → "thinking options type cannot be disabled when reasoning_effort is set" 关键是 output_config 字段,不是顶层的 reasoning_effort。 如果改用顶层 reasoning_effort(不带 output_config), deepseek-v4-pro 也能正常接受 thinking: disabled。 ## 尝试过的配置(均无效) - CLAUDE_CODE_SUBAGENT_MODEL=deepseek-v4-flash - MAX_THINKING_TOKENS=16000 - 移除 CLAUDE_CODE_EFFORT_LEVEL - 移除 [1m] 模型后缀 - CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK=1 确认是 Claude Code CLI 硬编码行为,无法从配置层面绕过。
Author
Owner

@jyzhu-pointless commented on GitHub (Jun 8, 2026):

所有的 2.1.166 及以上版本都应该有这个问题。

最直接的解决方案是回退到 2.1.165 及以下版本并禁用自动更新,或参考 Issue 配置 Proxy。

参考:

  1. Claude Code CHANGELOG,明确提到:

2.1.166

  • ...
  • MAX_THINKING_TOKENS=0, --thinking disabled, and the per-model thinking toggle now disable thinking on models that think by default via the Claude API (3P providers unchanged)

虽然 CHANGELOG 中提到 3P providers unchanged,但是 DeepSeek 接入 Claude Code 是走了 API Usage Billing 的路线,并非官方支持的第三方提供者路线,因此仍然出现了不兼容问题。

  1. Issue,提供了 Proxy 兼容层进行 workaround。
<!-- gh-comment-id:4647454221 --> @jyzhu-pointless commented on GitHub (Jun 8, 2026): **所有的 2.1.166 及以上版本都应该有这个问题。** 最直接的解决方案是回退到 2.1.165 及以下版本并禁用自动更新,或参考 [Issue](https://github.com/anthropics/claude-code/issues/65863) 配置 Proxy。 参考: 1. [Claude Code CHANGELOG](https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md),明确提到: > ## 2.1.166 > - ... > - `MAX_THINKING_TOKENS=0`, `--thinking disabled`, and the per-model thinking toggle now disable thinking on models that think by default via the Claude API (3P providers unchanged) 虽然 CHANGELOG 中提到 3P providers unchanged,但是 DeepSeek 接入 Claude Code 是走了 API Usage Billing 的路线,并非官方支持的第三方提供者路线,因此仍然出现了不兼容问题。 2. [Issue](https://github.com/anthropics/claude-code/issues/65863),提供了 Proxy 兼容层进行 workaround。
Author
Owner

@weidong commented on GitHub (Jun 8, 2026):

我会退到 2.1.159 版本了,正常了。

---- 回复的原邮件 ----
| 发件人 | Jinyu @.> |
| 日期 | 2026年06月08日 17:41 |
| 收件人 | @.
> |
| 抄送至 | @.>@.> |
| 主题 | Re: [deepseek-ai/awesome-deepseek-agent] Claude Code 启用子agent处理任务时,API 报错 "thinking options type cannot be disabled when reasoning_effort is set" (Issue #193) |
jyzhu-pointless left a comment (deepseek-ai/awesome-deepseek-agent#193)

所有的 2.1.166 及以上版本都应该有这个问题。

最直接的解决方案是回退到 2.1.165 及以下版本并禁用自动更新,或参考 Issue 配置 Proxy。

参考:

Claude Code CHANGELOG,明确提到:
2.1.166
...
MAX_THINKING_TOKENS=0, --thinking disabled, and the per-model thinking toggle now disable thinking on models that think by default via the Claude API (3P providers unchanged)

虽然 CHANGELOG 中提到 3P providers unchanged,但是 DeepSeek 接入 Claude Code 是走了 API Usage Billing 的路线,并非官方支持的第三方提供者路线,因此仍然出现了不兼容问题。

Issue,提供了 Proxy 兼容层进行 workaround。

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you commented.Message ID: @.***>

<!-- gh-comment-id:4647822148 --> @weidong commented on GitHub (Jun 8, 2026): 我会退到 2.1.159 版本了,正常了。 ---- 回复的原邮件 ---- | 发件人 | Jinyu ***@***.***> | | 日期 | 2026年06月08日 17:41 | | 收件人 | ***@***.***> | | 抄送至 | ***@***.***>***@***.***> | | 主题 | Re: [deepseek-ai/awesome-deepseek-agent] Claude Code 启用子agent处理任务时,API 报错 "thinking options type cannot be disabled when reasoning_effort is set" (Issue #193) | jyzhu-pointless left a comment (deepseek-ai/awesome-deepseek-agent#193) 所有的 2.1.166 及以上版本都应该有这个问题。 最直接的解决方案是回退到 2.1.165 及以下版本并禁用自动更新,或参考 Issue 配置 Proxy。 参考: Claude Code CHANGELOG,明确提到: 2.1.166 ... MAX_THINKING_TOKENS=0, --thinking disabled, and the per-model thinking toggle now disable thinking on models that think by default via the Claude API (3P providers unchanged) 虽然 CHANGELOG 中提到 3P providers unchanged,但是 DeepSeek 接入 Claude Code 是走了 API Usage Billing 的路线,并非官方支持的第三方提供者路线,因此仍然出现了不兼容问题。 Issue,提供了 Proxy 兼容层进行 workaround。 — Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today! You are receiving this because you commented.Message ID: ***@***.***>
Author
Owner

@stofancy commented on GitHub (Jun 9, 2026):

@jyzhu-pointless , Proxy 兼容层正常工作. 感谢.
另外, Mimo 的API 并没有这个问题.

<!-- gh-comment-id:4655086749 --> @stofancy commented on GitHub (Jun 9, 2026): @jyzhu-pointless , Proxy 兼容层正常工作. 感谢. 另外, Mimo 的API 并没有这个问题.
Author
Owner

@cwt9562 commented on GitHub (Jun 9, 2026):

回退到
claude install 2.1.165
正常了

<!-- gh-comment-id:4655826262 --> @cwt9562 commented on GitHub (Jun 9, 2026): 回退到 claude install 2.1.165 正常了
Author
Owner

@HerShin5 commented on GitHub (Jun 9, 2026):

补一个给 proxy / gateway 作者的实现建议:这个问题最好在 adapter 层做“互斥字段清洗”,不要只靠用户降版本。

现在看起来真正触发 400 的不是单纯 thinking: {"type":"disabled"},而是 disabled thinking 与 output_config.effort / reasoning effort 类字段同时存在。比较稳的策略是:

  1. 请求里有 thinking.type === "disabled" 时,转发到 DeepSeek/OpenAI-compatible 后端前删除 output_config.effort / reasoning_effort。
  2. workflow/subagent/websearch 单独加测试,因为它们和普通 chat 可能不是同一条请求路径。
  3. 如果网关支持多模型路由,最好允许针对具体模型关闭 effort 注入,而不是全局关。

我这边在 KiroForge 这类 OpenAI-compatible gateway 路由里也在重点看这个问题:base_url 兼容只是第一层,真正麻烦的是 Claude-style 参数、OpenAI-style 参数和各上游模型私有字段的归一化。这个 issue 对做兼容层的人很有参考价值。

<!-- gh-comment-id:4656667750 --> @HerShin5 commented on GitHub (Jun 9, 2026): 补一个给 proxy / gateway 作者的实现建议:这个问题最好在 adapter 层做“互斥字段清洗”,不要只靠用户降版本。 现在看起来真正触发 400 的不是单纯 `thinking: {"type":"disabled"}`,而是 disabled thinking 与 `output_config.effort` / reasoning effort 类字段同时存在。比较稳的策略是: 1. 请求里有 `thinking.type === "disabled"` 时,转发到 DeepSeek/OpenAI-compatible 后端前删除 `output_config.effort` / `reasoning_effort`。 2. workflow/subagent/websearch 单独加测试,因为它们和普通 chat 可能不是同一条请求路径。 3. 如果网关支持多模型路由,最好允许针对具体模型关闭 effort 注入,而不是全局关。 我这边在 KiroForge 这类 OpenAI-compatible gateway 路由里也在重点看这个问题:`base_url` 兼容只是第一层,真正麻烦的是 Claude-style 参数、OpenAI-style 参数和各上游模型私有字段的归一化。这个 issue 对做兼容层的人很有参考价值。
Author
Owner

@AC-NOMI commented on GitHub (Jun 9, 2026):

https://github.com/AC-NOMI/DeepseekAdapter 搞一层兼容,在设置了effort的时候把thinking字段过滤

<!-- gh-comment-id:4658192871 --> @AC-NOMI commented on GitHub (Jun 9, 2026): https://github.com/AC-NOMI/DeepseekAdapter 搞一层兼容,在设置了effort的时候把thinking字段过滤
Author
Owner

@seek-hope commented on GitHub (Jun 10, 2026):

这个是需要deepseek更新api规则还是claude code修复矛盾的硬编码参数?

<!-- gh-comment-id:4668618106 --> @seek-hope commented on GitHub (Jun 10, 2026): 这个是需要deepseek更新api规则还是claude code修复矛盾的硬编码参数?
Author
Owner

@AC-NOMI commented on GitHub (Jun 10, 2026):

来信已收悉!

<!-- gh-comment-id:4668622751 --> @AC-NOMI commented on GitHub (Jun 10, 2026): 来信已收悉!
Author
Owner

@jyzhu-pointless commented on GitHub (Jun 10, 2026):

这个是需要deepseek更新api规则还是claude code修复矛盾的硬编码参数?

应该只能等deepseek修复。claude code本来就没打算支持deepseek模型接入。

<!-- gh-comment-id:4668676447 --> @jyzhu-pointless commented on GitHub (Jun 10, 2026): > 这个是需要deepseek更新api规则还是claude code修复矛盾的硬编码参数? 应该只能等deepseek修复。claude code本来就没打算支持deepseek模型接入。
Author
Owner

@seek-hope commented on GitHub (Jun 10, 2026):

A出稳定发挥

<!-- gh-comment-id:4668694260 --> @seek-hope commented on GitHub (Jun 10, 2026): A出稳定发挥
Author
Owner

@seek-hope commented on GitHub (Jun 10, 2026):

问题已修复,大伙儿可以用v2.1.170了

<!-- gh-comment-id:4670214983 --> @seek-hope commented on GitHub (Jun 10, 2026): 问题已修复,大伙儿可以用v2.1.170了
Author
Owner

@Start-Ten commented on GitHub (Jun 11, 2026):

DeepSeek API服务应该已经更新了,解决了这个bug

<!-- gh-comment-id:4678790607 --> @Start-Ten commented on GitHub (Jun 11, 2026): DeepSeek API服务应该已经更新了,解决了这个bug
Author
Owner

@TaoZhengCN commented on GitHub (Aug 4, 2026):

DeepSeek API 修复了

<!-- gh-comment-id:5177167285 --> @TaoZhengCN commented on GitHub (Aug 4, 2026): DeepSeek API 修复了
Author
Owner

@AC-NOMI commented on GitHub (Aug 4, 2026):

来信已收悉!

<!-- gh-comment-id:5177172380 --> @AC-NOMI commented on GitHub (Aug 4, 2026): 来信已收悉!
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/awesome-deepseek-agent#68
No description provided.