fix(codex): filter unsupported DeepSeek V4 custom tools - #3003
Open
yuaiccc wants to merge 2 commits into
Open
Conversation
DeepSeek V4's Responses endpoint accepts apply_patch but rejects every other Codex custom tool (notably exec). Filter only the custom tool dialect while keeping ordinary function/MCP tools untouched, and reset tool_choice to auto when it references a removed custom tool. Signed-off-by: yuaiccc <yuaiccc@aliyun.com>
…m-tools # Conflicts: # apps/desktop/src/main/maker-host/__tests__/codexProxyHost.test.ts # apps/desktop/src/main/maker-host/codex-proxy-host.ts
|
| Filename | Overview |
|---|---|
| apps/desktop/src/main/maker-host/codex-proxy-host.ts | Adds and registers the narrowly model-gated DeepSeek V4 custom-tool sanitizer; no actionable defect was established. |
| apps/desktop/src/main/maker-host/tests/codexProxyHost.test.ts | Updates transform-chain expectations and verifies filtering of string/object custom tools while retaining apply_patch and function tools. |
Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile
MagicLizi
requested changes
Aug 19, 2026
MagicLizi
left a comment
Contributor
There was a problem hiding this comment.
格式门未通过
PR description 缺少必要段落,请补充以下内容:
- 这次改了什么 — 简要说明改动的目的和范围
- 怎么验证的 — 你是如何确认改动正确的(本地测试、复现步骤等)
- 风险 — 这个改动可能影响什么,有没有需要注意的边界情况
请参照 .github/PULL_REQUEST_TEMPLATE.md 补全 description 后推送新 commit 或编辑描述。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DeepSeek V4's Responses compatibility endpoint accepts the host's
apply_patchcustom tool but rejects every other Codex custom tool (notablyexec), causing 400 errors. This adds a narrow sanitization transform that:apply_patchtool_choicetoautowhen it references a removed custom toolTests
Added
removes unsupported DeepSeek V4 custom tools but retains apply_patchregression test covering exec string, exec custom object, apply_patch string/object, and function tools.pnpm --filter desktop typecheckpnpm test:unit:related(codexProxyHost tests)Risk
Low: transform is gated on
deepseek/deepseek-v4-proanddeepseek/deepseek-v4-flashmodel IDs only.