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
Gist updated.
The initial "fix" allowed me to actually interact with the model at least but it ran into issues calling tools. Turns out someone had patched the actual oauth plugin and I just did it that same way since it was merged anyway.
This actually works with tool calls now and is a good temporary fix until the OpenCode releases the official fix.
Lovely! And now you put my eyes on nixOs as well. Tnx!
... good temporary fix until the OpenCode releases the official fix.
if
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
awesome