Last active
January 14, 2026 23:30
-
-
Save critical/9825c35c5bb87bc32229f0000eef6cf4 to your computer and use it in GitHub Desktop.
OpenCode fix for Anthropic plans
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
| diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.ts | |
| --- a/packages/opencode/src/session/system.ts | |
| +++ b/packages/opencode/src/session/system.ts | |
| @@ -27,12 +27,12 @@ | |
| } | |
| export function provider(model: Provider.Model) { | |
| + if (model.providerID.includes("anthropic") && model.api.id.includes("claude")) return [] | |
| if (model.api.id.includes("gpt-5")) return [PROMPT_CODEX] | |
| if (model.api.id.includes("gpt-") || model.api.id.includes("o1") || model.api.id.includes("o3")) | |
| return [PROMPT_BEAST] | |
| if (model.api.id.includes("gemini-")) return [PROMPT_GEMINI] | |
| - if (model.api.id.includes("claude")) return [PROMPT_ANTHROPIC] | |
| return [PROMPT_ANTHROPIC_WITHOUT_TODO] | |
| } |
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
| { inputs, ... }: | |
| { | |
| environment.systemPackages = [ | |
| (inputs.opencode.packages.${pkgs.stdenv.hostPlatform.system}.default.overrideAttrs (old: { | |
| patches = | |
| (old.patches or []) | |
| ++ [ | |
| ./opencode-anthropic-system-prompt.patch | |
| ]; | |
| })) | |
| ]; | |
| } |
Author
I updated this gist for todays block
Patch is based on this PR: anomalyco/opencode#8553
Seems to work so far
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if