feat: support apply_patch for DeepSeek models - #37
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 843baaf489
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return Boolean(error && typeof error === "object" && "code" in error && error.code === code); | ||
| } | ||
|
|
||
| const APPLY_PATCH_MODEL_ID_PREFIXES = ["gpt-", "deepseek-"] as const; |
There was a problem hiding this comment.
Remove DeepSeek from the activation prefixes
For every deepseek-* model using one of the accepted Responses APIs, this prefix makes syncToolset remove write and edit and activate apply_patch, directly violating the repository constraint that the extension only activates for OpenAI GPT-family models. Keep non-GPT models on the standard editing tools unless that repository-wide constraint is intentionally changed.
AGENTS.md reference: AGENTS.md:L21-L25
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Addressed in 1ecf162: the deepseek- prefix is intentional and the repository constraint is updated accordingly — AGENTS.md now states the extension activates for OpenAI GPT-family models and DeepSeek models (id prefix deepseek-) exposed through openai-responses / openai-codex-responses APIs. Non-GPT models on other APIs remain on the standard editing tools.
843baaf to
1ecf162
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ecf162b98
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| export type ApplyPatchCandidateModel = Pick<Model<string>, "provider" | "id"> & Partial<Pick<Model<string>, "api">>; | ||
|
|
||
| export function isApplyPatchCapableModel(model: ApplyPatchCandidateModel | undefined): boolean { | ||
| if (!model || !APPLY_PATCH_MODEL_ID_PREFIXES.some((prefix) => model.id.startsWith(prefix))) { |
There was a problem hiding this comment.
Require a Responses API before activating DeepSeek
When a deepseek-* model uses a provider in GPT_APPLY_PATCH_PROVIDERS but a different API, such as { provider: "openai", id: "deepseek-custom", api: "openai-completions" }, this expanded prefix check admits it because the existing provider branch bypasses the API allowlist. syncToolset consequently removes write and edit, even though DeepSeek activation is restricted to openai-responses and openai-codex-responses; require an allowed API specifically for the DeepSeek prefix while retaining the provider shortcut for GPT models.
AGENTS.md reference: AGENTS.md:L24-L24
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 7d910bc: the deepseek- prefix now requires an allowed Responses API (openai-responses / openai-codex-responses) and no longer falls through the provider-allowlist shortcut, which remains exclusive to GPT models. Regression test added for { provider: "openai", id: "deepseek-custom", api: "openai-completions" } → not activated.
1ecf162 to
b3e9427
Compare
Requirement
The extension only enables
apply_patch(replacingwrite/edit) when the model id starts withgpt-. DeepSeek V4 Flash used through the OpenCode Go Responses endpoint (api: openai-responses) already supportsapply_patch, so the extension should support it too.Changes
gpt-togpt-anddeepseek-, and add theisApplyPatchCapableModelpredicateisOpenAIGptModelas a deprecated compatibility aliassyncToolsetnow uses the new predicate, so DeepSeek models exposed viaopenai-responses/openai-codex-responsesalso replacewrite/editwithapply_patch