Skip to content

fix deepseek v4 thinking compatible#1375

Open
MattBow wants to merge 1 commit into
musistudio:mainfrom
MattBow:fix/deepseek-v4-pro-thinking
Open

fix deepseek v4 thinking compatible#1375
MattBow wants to merge 1 commit into
musistudio:mainfrom
MattBow:fix/deepseek-v4-pro-thinking

Conversation

@MattBow
Copy link
Copy Markdown

@MattBow MattBow commented May 1, 2026

适配deepseek v4中思考模式的输入要求(https://api-docs.deepseek.com/zh-cn/guides/thinking_mode)

  1. deepseek.transformer.ts — 请求方向转换缺失
  • 问题:assistant 消息的 thinking 未转为 DeepSeek 所需的 reasoning_content;reasoning 参数未转为 thinking + reasoning_effort
  • 修复:在 transformRequestIn 中添加 thinking → reasoning_content 和 reasoning → thinking + reasoning_effort 的转换
  1. deepseek.transformer.ts — 非流式响应未转换
  • 问题:transformResponseOut 对 JSON 响应原样透传,未将 reasoning_content 转为 thinking
  • 修复:在 JSON 响应处理中添加 reasoning_content → thinking 的转换
  1. anthropic.transformer.ts:164 — thinking 块因缺少 signature 被丢弃
  • 问题:c.type === "thinking" && c.signature 条件要求 signature 必须存在,但 Claude Code 传回的 thinking 块 signature 可能为空
  • 修复:放宽为 c.type === "thinking",signature 有则保留、无则省略

配置要求
deepseek provider 必须配置 transformer(provider 级别):
"transformer": { "use": ["deepseek"] }
否则 transformer 不会被执行。

关联Issue:
#1355

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant