Skip to content

fix(providers): respect requestFormat for DeepSeek models - #370

Merged
su-fen merged 2 commits into
Stack-Cairn:mainfrom
ISO-N:fix/deepseek-responses-request-format
Aug 4, 2026
Merged

fix(providers): respect requestFormat for DeepSeek models#370
su-fen merged 2 commits into
Stack-Cairn:mainfrom
ISO-N:fix/deepseek-responses-request-format

Conversation

@ISO-N

@ISO-N ISO-N commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

关联 Issue

Closes #369

概述

DeepSeek 官方已支持 OpenAI Responses API,但 createModelFromConfig() 仍会在模型 ID 含 deepseek 时强制把请求路由到 openai-completions,忽略用户显式选择的 requestFormat

本 PR 删除这个强制路由。对 codex 供应商来说,requestFormat 现在决定 openai-responses 还是 openai-completions,与 Qwen、GLM、Kimi、MiniMax、OpenRouter 等 OpenAI 兼容供应商行为一致。DeepSeek 专有适配仅在最终模型 API 为 openai-completionsanthropic-messages 时生效。

文档:N/A。本改动是让实际请求回归用户已配置的 requestFormat,没有新增或修改面向用户的文档。

变更范围

  • 模块:agent-gui
  • 关键路径:
    • crates/agent-gui/src/lib/providers/runtime/modelFactory.ts
    • crates/agent-gui/src/lib/providers/deepSeekProviderAdapter.ts
    • crates/agent-gui/test/providers/request-options.test.mjs:删除因行为变更失效的 DeepSeek request-format 测试

截图 / 预览

image

验证

  • cd crates/agent-gui && node --test test/providers/*.test.mjs -> 228 通过
  • cd crates/agent-gui && pnpm exec tsc --noEmit -> 通过
  • 按上游评审意见移除本改动引入/改写的 DeepSeek request-format 专项测试,保留 DeepSeek Anthropic/DSML 等既有专项测试。

提交前检查

  • 已关联需求 issue(若属于无需 issue 的微小修复,已在概述中说明)。
  • 已同步目标分支,无合并冲突。
  • 改动聚焦,无无关重构。
  • 未包含密钥、Token 或个人信息。
  • 涉及用户行为、部署或配置的变更已同步文档。

DeepSeek now supports the OpenAI Responses API, but modelFactory still forces deepseek model IDs onto openai-completions. Let requestFormat decide the protocol and keep DeepSeek adapters scoped to the actual completions/anthropic paths.
@StackCairn
StackCairn marked this pull request as draft August 3, 2026 17:12
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

PR governance checks passed. Awaiting human review.

@ISO-N
ISO-N marked this pull request as ready for review August 3, 2026 17:27
@FlowerRealm

Copy link
Copy Markdown
Contributor

测试是不需要的, 可以删去

@su-fen
su-fen merged commit 4ed3ea1 into Stack-Cairn:main Aug 4, 2026
9 checks passed
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.

[Bug] DeepSeek 模型选择 Responses API 时仍被强制路由到 Chat Completions

3 participants