GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — tweak: include anthropic spoof for providers including "anthropic" in name by Gardelll · Pull Request #5166 · anomalyco/opencode

Conversation

@Gardelll

@Gardelll Gardelll commented Dec 6, 2025

Copy link
Copy Markdown

Prefix compaction/summarize/title system instruction with PROMPT_ANTHROPIC_SPOOF to support proxied Anthropic provider.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@rekram1-node

rekram1-node commented Dec 6, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

The anthropic spoof is there solely for coding max/pro plans, are you running opencode through a proxy to your max plan? Because you may not really want that spoof unless you're doing that

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Gardelll

Gardelll commented Dec 6, 2025

Copy link
Copy Markdown
Author

The anthropic spoof is there solely for coding max/pro plans, are you running opencode through a proxy to your max plan? Because you may not really want that spoof unless you're doing that

Yes, it sounds unsafe, but there is indeed such a need.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node rekram1-node changed the title Support proxied Anthropic provider for compaction/summarize/title task tweak: include anthropic spoof for providers including "anthropic" in name Dec 6, 2025
@rekram1-node

rekram1-node commented Dec 6, 2025

Copy link
Copy Markdown
Member

I don't know if we should be including it all the time, for example: google-vertex-anthropic is a valid provider, no reason to attach it in that case

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node

rekram1-node commented Dec 6, 2025

Copy link
Copy Markdown
Member

that is the only provider I see this being an issue for, but fr? You have a proxy setup that uses claude code subscriptions?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Gardelll

Gardelll commented Dec 6, 2025

Copy link
Copy Markdown
Author

I don't know if we should be including it all the time, for example: google-vertex-anthropic is a valid provider, no reason to attach it in that case

Maybe we should use another option to include this spoof for custom providers?

that is the only provider I see this being an issue for, but fr? You have a proxy setup that uses claude code subscriptions?

I am using a config like this to bypass regional restrictions:

"anthropic-proxy": {
  "npm": "@ai-sdk/anthropic",
  "name": "ProxiedClaudeCode",
  "options": {
    "baseURL": "https://proxied-claude-endpoint/v1",
    "headers": {
      // claude code cli headers
    }
  },
  "models": {
    // ...
  }
}

It is working fine but excludes title generation, etc.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node

rekram1-node commented Dec 6, 2025

Copy link
Copy Markdown
Member

ig this is fine, should prolly just exclude the case I mentioned

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cgwalters

cgwalters commented Dec 17, 2025

Copy link
Copy Markdown

I tested this out, and also had Opus 4.5 do a local review and it noticed that this PR was missing a case; this patch should apply to the tip of this PR.

diff --git i/packages/opencode/src/session/system.ts w/packages/opencode/src/session/system.ts
index 5996f6c2b..ed15b35d1 100644
--- i/packages/opencode/src/session/system.ts
+++ w/packages/opencode/src/session/system.ts
@@ -25,7 +25,7 @@ export namespace SystemPrompt {
   }
 
   export function header(providerID: string) {
-    if (providerID.includes("anthropic")) return [PROMPT_ANTHROPIC_SPOOF.trim()]
+    if (shouldIncludeAnthropicSpoof(providerID)) return [PROMPT_ANTHROPIC_SPOOF.trim()]
     return []
   }

On top of that, I think it'd be more elegant if we did it this way:

diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.ts
index ed15b35d1..1fc7f61a4 100644
--- a/packages/opencode/src/session/system.ts
+++ b/packages/opencode/src/session/system.ts
@@ -20,13 +20,15 @@ import PROMPT_CODEX from "./prompt/codex.txt"
 import type { Provider } from "@/provider/provider"
 
 export namespace SystemPrompt {
-  function shouldIncludeAnthropicSpoof(providerID: string) {
-    return providerID !== "google-vertex-anthropic" && providerID.includes("anthropic")
+  function providerSpoof(providerID: string) {
+    if (providerID !== "google-vertex-anthropic" && providerID.includes("anthropic")) {
+      return [PROMPT_ANTHROPIC_SPOOF.trim()]
+    }
+    return []
   }
 
   export function header(providerID: string) {
-    if (shouldIncludeAnthropicSpoof(providerID)) return [PROMPT_ANTHROPIC_SPOOF.trim()]
-    return []
+    return [...providerSpoof(providerID)]
   }
 
   export function provider(model: Provider.Model) {
@@ -124,23 +126,14 @@ export namespace SystemPrompt {
   }
 
   export function compaction(providerID: string) {
-    if (shouldIncludeAnthropicSpoof(providerID)) {
-      return [PROMPT_ANTHROPIC_SPOOF.trim(), PROMPT_COMPACTION]
-    }
-    return [PROMPT_COMPACTION]
+    return [...providerSpoof(providerID), PROMPT_COMPACTION]
   }
 
   export function summarize(providerID: string) {
-    if (shouldIncludeAnthropicSpoof(providerID)) {
-      return [PROMPT_ANTHROPIC_SPOOF.trim(), PROMPT_SUMMARIZE]
-    }
-    return [PROMPT_SUMMARIZE]
+    return [...providerSpoof(providerID), PROMPT_SUMMARIZE]
   }
 
   export function title(providerID: string) {
-    if (shouldIncludeAnthropicSpoof(providerID)) {
-      return [PROMPT_ANTHROPIC_SPOOF.trim(), PROMPT_TITLE]
-    }
-    return [PROMPT_TITLE]
+    return [...providerSpoof(providerID), PROMPT_TITLE]
   }
 }
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@cgwalters

cgwalters commented Dec 17, 2025

Copy link
Copy Markdown

FTR my interest in this PR is because we have this system prompt in our projects https://github.com/bootc-dev/infra/blob/dbc0159ca4b672e83cd3442917a5e8e0bfcb183d/common/AGENTS.md#attribution and I was really confused why most of the time OpenCode emitted Assisted-by: Claude Code

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Gardelll

Gardelll commented Dec 20, 2025

Copy link
Copy Markdown
Author

This feature has been implemented in a different, unified way. However, special handling for google-vertex-anthropic is still lacking.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Gardelll
fix: exclude google vertex in anthropic system prompt spoof
3e3798d
@Gardelll
Gardelll force-pushed the dev branch from b963e86 to 3e3798d Compare December 20, 2025 18:23
@cgwalters

cgwalters commented Jan 9, 2026

Copy link
Copy Markdown

Friendly ping for review on this one, this is my biggest papercut right now with opencode.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot mentioned this pull request Jan 14, 2026
fix: skip system prompt for claude #8553
Closed
@github-actions github-actions Bot mentioned this pull request Jan 23, 2026
feat: add openai-compatible endpoint support for google-vertex provider #10303
Merged
@cgwalters

cgwalters commented Jan 26, 2026

Copy link
Copy Markdown

It looks like 94dd0a8 obsoletes this. I have to say though "rm spoof" is quite a minimal commit message and could have used some rationale...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@rekram1-node

rekram1-node commented Jan 26, 2026

Copy link
Copy Markdown
Member

You can use the system message transform hook:
https://github.com/anomalyco/opencode-anthropic-auth/commit/a931d125f48014825c1ed1807275a261d3ccd814

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Gardelll

Gardelll commented Jan 27, 2026

Copy link
Copy Markdown
Author

Closed due to outdated.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Gardelll Gardelll closed this Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Gardelll @rekram1-node @cgwalters
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.