Skip to content

anthropic legal requests#18186

Merged
thdxr merged 2 commits intodevfrom
anthropic-legal-rebased
Mar 19, 2026
Lines changed: 18 additions & 193 deletions
Merged

anthropic legal requests#18186
thdxr merged 2 commits intodevfrom
anthropic-legal-rebased

Conversation

@thdxr
Copy link
Member

@thdxr thdxr commented Mar 19, 2026

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

@greptile-apps
Copy link

greptile-apps bot commented Mar 19, 2026

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

Filename Overview
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.

Flowchart

%%{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]
    D --> E
    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]
    end

    style D fill:#f99,stroke:#c00
    style I fill:#9f9,stroke:#090
    style J fill:#ccc,stroke:#999

Comments Outside Diff (1)

  1. packages/web/src/content/docs/providers.mdx, line 304-305 (link)

    P2 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..."

Comment on lines 209 to +215
headers: {
...(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") && {
"x-opencode-project": Instance.project.id,
"x-opencode-session": input.sessionID,
"x-opencode-request": input.user.id,
"x-opencode-client": Flag.OPENCODE_CLIENT,
}),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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
headers: {
...(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") && {
"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.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,
}
: {
"User-Agent": `opencode/${Installation.VERSION}`,
}),

@thdxr thdxr enabled auto-merge (squash) March 19, 2026 04:41
@thdxr thdxr merged commit 1ac1a02 into dev Mar 19, 2026
8 checks passed
@thdxr thdxr deleted the anthropic-legal-rebased branch March 19, 2026 04:45
div1spawncamper pushed a commit to div1spawncamper/opencode that referenced this pull request Mar 19, 2026
AvatarGanymede pushed a commit to AvatarGanymede/opencode-dev that referenced this pull request Mar 19, 2026
demostanis pushed a commit to demostanis/opencode that referenced this pull request Mar 19, 2026
filipeandre pushed a commit to filipeandre/opencode that referenced this pull request Mar 19, 2026
@cdbattags
Copy link

cdbattags commented Mar 19, 2026

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

@jsmjsm
Copy link

jsmjsm commented Mar 19, 2026

What should and what can we do???

@cdbattags
Copy link

We need to work together to find a solution that doesn't involve the OpenCode name

We have all the tools

@ben-pr-p
Copy link

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

kent-3 added a commit to kent-3/opencode that referenced this pull request Mar 19, 2026
kent-3 added a commit to kent-3/opencode that referenced this pull request Mar 19, 2026
@cdbattags
Copy link

@griffinmartin has a plugin incoming that will fix

@ondrek
Copy link

ondrek commented Mar 19, 2026

The obvious question here is.. what's the border between normal enforcement of product boundaries and a hostile move against third-party harnesses.

@cedws
Copy link

cedws commented Mar 19, 2026

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

@CustomIcon
Copy link

For as i know. i been using claude on latest update via custom provider :/ idk if this changes anything beyond our current use for opencode

@cdbattags
Copy link

cdbattags commented Mar 19, 2026

https://github.com/griffinmartin/opencode-claude-auth

https://www.npmjs.com/package/opencode-claude-auth

@lee-b
Copy link

lee-b commented Mar 20, 2026

Worth considering: https://en.wikipedia.org/wiki/Code_as_speech

@Yvancg
Copy link

Yvancg commented Mar 20, 2026

Lame. Switching to OpenAI. 5.4 gives pretty good results.

raf1hh pushed a commit to raf1hh/opencode that referenced this pull request Mar 20, 2026
@samebutdiff
Copy link

https://pi.dev still supports logging in with your Claude subscription

@yuthikaxsagarage
Copy link

yuthikaxsagarage commented Mar 20, 2026

Bye bye claude subscription, what an idiot of a ceo . They cannot make a cli which doesn't glitch like an alien movie, and yet cancels the only thing that works with their product

@scorpionate
Copy link

screenshot 2

@griffinmartin
Copy link

https://github.com/griffinmartin/opencode-claude-auth is stable and confirmed working.

@w568w
Copy link

w568w commented Mar 20, 2026

Thanks to the amazing work of the OSS community.

Btw, if you're using Arch Linux, I've just created an AUR package for easier installation: https://aur.archlinux.org/packages/opencode-claude-auth

soar added a commit to soar/opencode that referenced this pull request Mar 20, 2026

Verified

This commit was signed with the committer’s verified signature.
soar Aleksey @soar Smyrnov
This reverts commit 1ac1a02 (anomalyco#18186)
@soar
Copy link

soar commented Mar 20, 2026

We need a plugin manager system here, so such plugins can be downloaded and installed automatically

@goxofy
Copy link

goxofy commented Mar 20, 2026

the anthropic need to be die

@van-sprundel
Copy link

van-sprundel commented Mar 20, 2026

What a loss we had today...

@ggi-svg
Copy link

ggi-svg commented Mar 20, 2026

image bye bye claude !

@shahidshabbir-se
Copy link

Community workaround available: opencode-anthropic-oauth

Direct browser OAuth — no Claude Code installation or credential syncing needed.

{
  "plugin": ["opencode-anthropic-oauth"]
}

GitHub: https://github.com/shahidshabbir-se/opencode-anthropic-oauth
npm: https://www.npmjs.com/package/opencode-anthropic-oauth

@redbaron
Copy link

OK, there are plugins now to fetch Claude Code tokens, but this PR goes bigger than tokens: anthropic provider removal. Once this PR is released, what needs to be done to keep it working?

@Lewiscowles1986
Copy link

They just seem like such scumbags. Hey let us abuse our users because we wrote some legalese.
How about you just charge people enough to make a profit, and then be happy for paying customers?
The only people that think this predatory VC behaviour, however normalised is okay, are awful humans, that should not be left in-charge of a pet-rock.

Just rate-limit if it's such an issue for service health; but no... some management consulting nitwit convinced them

nobody will use their capacity
and so now they are trying to enforce that.

I like the anthropic models and the openai models, because they just are better than open models that normal people can run without a bunch of investment. This isn't using any proprietary tech within the CLI... Anthropic are trying to weaponise, legally their terribly implemented APIs (from a perspective this could cause them any damages); this is not even like soft-modding a console; it's using different hardware to run games you already pay for access to. Ugh

@0xtresser
Copy link

Anthropic, a company named after 'humanity,' why does it constantly fail to act like one?

dfadev added a commit to dfadev/opencode that referenced this pull request Mar 20, 2026
@JamesXNelson
Copy link

Anthropic, a company named after 'humanity,' why does it constantly fail to act like one?

I mean, have you seen the greedy things humans do?
This move (which I [hopefully obviously] do not support) is pretty on-point for humans.

@0xtresser
Copy link

0xtresser commented Mar 20, 2026 via email

@qraxiss
Copy link

qraxiss commented Mar 20, 2026

loser dario

@cdbattags
Copy link

cdbattags commented Mar 20, 2026

Proud of all the peeps here with creative solutions! I think the next steps would be for someone to launch a plugin that actively manages something like https://github.com/router-for-me/CLIProxyAPI in order to make it even harder for them to catch us! 😉

The gist is that we want a plugin that would manage a Proxy directly instead of worrying about headers and whatnot. This would involve adding a PR to support a plugin auto-registering a new provider, potentially, but WE CAN DO THIS!

The power of open source is amazing

Friendly reminder that OpenCode team will probably not be rearing their heads in here due to legal, but let's all remember that forks are not the answer! Maybe one day they can spin out maintainership of this repo to a non-profit instead of it conflicting with their Zen product's economics 😁

@van-sprundel
Copy link

The underlying issue is that anthropic does not want these tools to integrate with their subscription api. Making plug-ins does not work in the long-run.

@cdbattags
Copy link

cdbattags commented Mar 20, 2026

The underlying issue is that anthropic does not want these tools to integrate with their subscription api. Making plug-ins does not work in the long-run.

Things like these are a game of whack-a-mole. You just need more moles. That's why open-source wins.

Plugins specifically also shifts the liability away from Anomaly which is perfect!

@adiled
Copy link

adiled commented Mar 20, 2026

@cdbattags tools will be spun up for sure, I have one being churned out that uses CC like anthropic wants it to be used, fully compliant, OC remains in the driving seat. Zen with Kimi K2.5 free quota with its overthinking has got it to a point. There's also https://github.com/unixfox/opencode-claude-code-plugin that gets closest to a provider.

It's not the OC community that has to go around anthropic, anthropic is stumbling around not just OC but entire dev landscape. The more features they mount on the REPL, the more they tangle themselves as their compliance model caves into itself. It's a vicious loop. I hope CC team is enjoying the process maintaining their obfuscated contraption and soaking it all in as entertainment, that's the only way for them to learn and grow along with us.

@RazoBeckett
Copy link

The day. I was here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

None yet