[来源关键摘录] March 19, 2026 PR removing the built-in Anthropic OAuth plugin and references from OpenCode in response to Anthropic legal requests.
[正文前段节选] Skip to content
Navigation Menu
Appearance settings
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.
You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
Repository navigation
anthropic legal requests - #18186
thdxr merged 2 commits into
devanomalyco/opencode:devfrom
anthropic-legal-rebasedanomalyco/opencode:anthropic-legal-rebasedCopy head branch name to clipboard
Mar 19, 2026
anthropic legal requests#18186
Conversation
Copy Markdown
Remove anthropic references per legal requests:
Remove anthropic-20250930.txt prompt file
Remove anthropic from provider hints
Remove opencode-anthropic-auth builtin plugin
Remove anthropic from provider enum
anthropic legal requests
github-actions
greptile-apps
There was an error while loading. Please reload this page.
Greptile Summary
This PR removes Anthropic-specific references from the codebase per legal requirements, including the branded system prompt file, the opencode-anthropic-auth built-in plugin, the claude-code-20250219 beta header flag, and the Anthropic hint from the provider login UI. The documentation is also updated to reflect that Anthropic OAuth/Pro-Max auth is prohibited.
Key changes:
anthropic-20250930.txt system prompt deleted
opencode-anthropic-auth@0.0.13 removed from built-in plugins and the OPENCODE_DISABLE_DEFAULT_PLUGINS guard removed with it
claude-code-20250219 dropped from the anthropic-beta request header
Provider login hint and docs updated to remove Claude Pro/Max OAuth flow
Issues found:
The header refactor in llm.ts silently drops the User-Agent: opencode/${VERSION} header that was previously sent to all non-opencode, non-anthropic providers (OpenAI, Google, Azure, etc.) — likely an unintentional side-effect of removing the Anthropic exclusion branch
Step 2 of the Anthropic section in providers.mdx still references "the Claude Pro/Max option" in its prose, but the accompanying UI code block now only shows Manually enter API Key
Confidence Score: 3/5
Safe to merge after verifying the User-Agent header removal is intentional and fixing the stale docs prose.
The core removals (plugin, prompt file, beta flag, UI hint) are clean and well-scoped. Two issues prevent a higher score: the User-Agent header is silently dropped for all non-opencode providers as a side-effect of the llm.ts refactor (a potential P1 regression), and the docs step 2 description is left inconsistent with the updated UI.
packages/opencode/src/session/llm.ts (User-Agent regression) and packages/web/src/content/docs/providers.mdx (stale step description)
Important Files Changed
packages/opencode/src/session/llm.ts
Simplifies header logic to remove Anthropic-specific exclusion, but inadvertently drops the User-Agent header that was previously sent to all non-opencode, non-anthropic providers (OpenAI, Google, Azure, etc.).
packages/web/src/content/docs/providers.mdx
Documentation updated to remove Claude Pro/Max OAuth flow, but step 2 prose still references the removed "Claude Pro/Max option", leaving the description inconsistent with the updated UI code block.
packages/opencode/src/plugin/index.ts
Removes the opencode-anthropic-auth@0.0.13 builtin plugin and the associated Flag.OPENCODE_DISABLE_DEFAULT_PLUGINS check; clean and straightforward removal.
packages/opencode/src/provider/provider.ts
Removes claude-code-20250219 from the anthropic-beta request header; remaining beta flags (interleaved-thinking, fine-grained-tool-streaming) are unaffected.
packages/opencode/src/cli/cmd/providers.ts
Removes the anthropic: "API key" hint label from the provider login selection UI; clean one-line removal.
packages/opencode/src/session/prompt/anthropic-20250930.txt
File deleted entirely per legal request; removal of the Anthropic-branded system prompt is intentional and complete.
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[LLM.stream called] --> B{providerID starts with 'opencode'?}
B -- Yes --> C[Add x-opencode-project/session/request/client headers]
B -- No --> D[No extra headers added]
C --> E[Merge model.headers]
E --> F[Merge plugin chat.headers]
F --> G[streamText call]
subgraph "Before PR (removed path)"
H{providerID !== 'anthropic'?}
H -- Yes --> I["Add User-Agent: opencode/VERSION"]
H -- No --> J[undefined — no headers]
style D fill:#f99,stroke:#c00
style I fill:#9f9,stroke:#090
style J fill:#ccc,stroke:#999
Comments Outside Diff (1)
packages/web/src/content/docs/providers.mdx, line 304-305 (link)
Stale step description references removed UI option
The code block in step 2 was correctly updated to only show Manually enter API Key, but the prose above it still says "Here you can select the Claude Pro/Max option and it'll open your browser and ask you to authenticate." — which no longer matches the available UI since the Claude Pro/Max and Create an API Key options were removed.
Last reviewed commit: "anthropic legal requ..."
View reviewed changes
Comment thread
Comment on lines
...(input.model.providerID.startsWith("opencode")
"x-opencode-project": Instance.project.id,
"x-opencode-session": input.sessionID,
"x-opencode-request": input.user.id,
"x-opencode-client": Flag.OPENCODE_CLIENT,
: input.model.providerID !== "anthropic"
"User-Agent": `opencode/${Installation.VERSION}`,
: undefined),
...(input.model.providerID.startsWith("opencode") && {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Silent removal of User-Agent header for third-party providers
The original logic sent User-Agent: opencode/${Installation.VERSION} to all providers except opencode-prefixed and anthropic ones. The refactored code only adds the x-opencode-* headers for opencode providers and adds nothing for everyone else — meaning providers like openai, google, azure, openrouter, etc. silently lose the User-Agent header.
This is likely an unintended side-effect of removing the anthropic-specific exclusion. The ternary was restructured into a simple &&, dropping the middle branch entirely.
If intentional, this should be documented. If unintentional, consider restoring it:
Suggested change
docs: clarify bundled plugin removal
enabled auto-merge (squash)
March 19, 2026 04:41
Hide details
View details
merged commit 1ac1a02
8 checks passed
anthropic-legal-rebased
March 19, 2026 04:45
div1spawncamper
pushed a commit
to div1spawncamper/opencode
that referenced
this pull request
Revert "anthropic legal requests (anomalyco#18186)"
This reverts commit 1ac1a02.
I can't tell if the lack of noise in here is a good or bad thing haha
Not trying to start something but oooooof this sucks
@thdxr has his hands tied but we as the community can stand up
thlindustries
mentioned this pull request
Claude code 0auth broked!?
What should and what can we do???
We need to work together to find a solution that doesn't involve the OpenCode name
We have all the tools
It seems like the change here is that the plugin will not be loaded by default, not that the plugin won't work. It seems like a truly third party plugin is still possible
fix(provider): split Bedrock 1M context models into explicit 200K and 1M variants
@griffinmartin has a plugin incoming that will fix
The obvious question here is.. what's the border between normal enforcement of product boundaries and a hostile move against third-party harnesses.
I think the best solution to use Anthropic models with OpenCode without breaking the bank at the moment is through a Copilot subscription.
I've created a gist for research purposes describing how one would implement the OAuth flow and impersonate Claude Code: https://gist.github.com/cedws/3a24b2c7569bb610e24aa90dd217d9f2
[...内容已截断,完整版请查看原文或 Wayback 快照]