Skip to content

anthropic legal requests#18186

Merged
thdxr merged 2 commits intodevfrom
anthropic-legal-rebased
Mar 19, 2026
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
Loading

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

@adiled
Copy link

adiled commented Mar 21, 2026

clwnd is now rolled out as well, uses claude CLI efficiently (no slowness yet IME). It stitches OC and CC sessions in realtime, driven via an always up standalone runtime that plugs into opencode.

I'm actively building enhancements / fixing things right now so welcoming testers / tinkerers.

Upcoming essentials: OC permissions respected, sidebar stats, continuation of existing OC sessions without memory cold start in claude-pair session. Eventually: anchor into existing non-OC managed CC sessions, windows support.

Opencode's runtime doesn't touch CC at all (clwnd's does) so it is fully OC core legal safe and forward compatible; Because neither OC runtime, nor the OC pugin, nor the clwnd's runtime reads / writes claude auth, it is CC-user-account safe too.

@cedws
Copy link

cedws commented Mar 21, 2026

@adiled If I understand correctly you're routing OpenCode API calls through Claude Code? Interesting approach if so, would like to see some documentation on how it works in detail. I saw one other project taking a similar approach but it's not actively developed.

@adiled
Copy link

adiled commented Mar 21, 2026

@cedws claude cli json stream is used for in and out, OC drives the session. clwnd brokers the file system operations (grep, read, write etc) via its mcp, delegating execution invocation to claude, but with opencode permissioning / user governance and opencode TUI compatibility. Structurally not entirely novel, it's an intuitive design, with a touch of dev accessibility and autonomy that I fancy. I'll surely add some under the hood visuals in a dedicated doc!

About maintaining, it's fresh out with some rough edges and OC feature completeness yet to be tested, but if it does come to it being unusable down the road, I'll myself turn the executable into an opt-in easy offramp to functioning alternatives.

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

How is blackbox able to offer Claude code and Claude models within their harness?

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

KieranP commented Mar 23, 2026

I wonder if OpenCode could do something similar to Zed Editor. It uses Claude SDK to run requests through Claude Code via ACP. As far as Anthropic is concerned, all requests are coming from Claude Code.

https://agentclientprotocol.com/get-started/introduction
https://zed.dev/docs/ai/external-agents#claude-agent
https://github.com/zed-industries/claude-agent-acp

It would be nice to see Claude in OpenCode again, OpenCode is far superior to Claude Code CLI.

@van-sprundel
Copy link

van-sprundel commented Mar 23, 2026

TIL zed already has subagent support. https://zed.dev/releases/stable/0.227.1

thanks for the tip @KieranP

was already using zed for most things, kind of forgot that AI was a thing there since I'd turned it off ..

Edit: nvm, you cannot call subagents within zed yet. guess I'll wait for zed-industries/zed#34154

Copy link

Choose a reason for hiding this comment

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

Instead of deleting it, it was easier to implement a solution.

You probably deleted it because your grandma hit you in the mouth with a slipper and you got scared.
You're pathetic.

Copy link

@griffinmartin griffinmartin Mar 23, 2026

Choose a reason for hiding this comment

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

@titet11 No need to be dramatic, you're free to use https://github.com/griffinmartin/opencode-claude-auth or the plethora of other solutions that have been made in response to this.

:::info
Using your Claude Pro/Max subscription in OpenCode is not officially supported by [Anthropic](https://anthropic.com).
:::
There are plugins that allow you to use your Claude Pro/Max models with

Choose a reason for hiding this comment

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

Why did they make this change? Did they receive a warning letter or something like that?

import { Log } from "../util/log"
import { createOpencodeClient } from "@opencode-ai/sdk"
import { Server } from "../server/server"
import { BunProc } from "../bun"

Choose a reason for hiding this comment

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

Get In Touch

DeYouOS added a commit to DeYouOS/opencode that referenced this pull request Mar 25, 2026
- 恢复 providers.ts 中的 Anthropic 认证提示
- 恢复 llm.ts 中对 Anthropic 提供者的请求头处理
- 恢复 anthropic-20250930.txt 提示文件
- 恢复 providers.mdx 中关于 Anthropic 的文档信息
dfadev added a commit to dfadev/opencode that referenced this pull request Mar 25, 2026
dfadev added a commit to dfadev/opencode that referenced this pull request Mar 25, 2026
dfadev added a commit to dfadev/opencode that referenced this pull request Mar 26, 2026
dfadev added a commit to dfadev/opencode that referenced this pull request Mar 26, 2026
dfadev added a commit to dfadev/opencode that referenced this pull request Mar 26, 2026
DeYouOS added a commit to DeYouOS/opencode that referenced this pull request Mar 26, 2026
还原官方因法律请求移除的 Anthropic 相关功能:
- 恢复 opencode-anthropic-auth 内置插件
- 恢复 claude-code-20250219 beta header
- 恢复 anthropic prompt 文件
- 恢复 provider 登录提示
- 恢复文档中的 OAuth 订阅说明
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.