FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

anthropic legal requests by thdxr · Pull Request #18186 · anomalyco/opencode · GitHub

anthropic legal requests - #18186

Merged
thdxr merged 2 commits into
devfrom
anthropic-legal-rebased
Mar 19, 2026
Merged

anthropic legal requests#18186
thdxr merged 2 commits into
devfrom
anthropic-legal-rebased

Conversation

thdxr commented Mar 19, 2026

Copy link
Copy Markdown
Member

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 Bot commented Mar 19, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

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)

    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
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 enabled auto-merge (squash) March 19, 2026 04:41
thdxr merged commit 1ac1a02 into dev Mar 19, 2026
8 checks passed
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

cdbattags commented Mar 19, 2026
edited
Loading

Copy link
Copy Markdown

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 commented Mar 19, 2026

Copy link
Copy Markdown

What should and what can we do???

Copy link
Copy Markdown

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

We have all the tools

Copy link
Copy Markdown

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

Copy link
Copy Markdown

@griffinmartin has a plugin incoming that will fix

ondrek commented Mar 19, 2026

Copy link
Copy Markdown

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

cedws commented Mar 19, 2026

Copy link
Copy Markdown

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

Copy link
Copy Markdown

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 commented Mar 19, 2026
edited
Loading

Copy link
Copy Markdown

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

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

lee-b commented Mar 20, 2026

Copy link
Copy Markdown

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

Copy link
Copy Markdown

shame really

van-sprundel commented Mar 23, 2026
edited
Loading

Copy link
Copy Markdown

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

:::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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Legal notice seems like

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 的文档信息
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 订阅说明
rbasto1 added a commit to rbasto1/opencode that referenced this pull request Mar 30, 2026

Copy link
Copy Markdown

Is it just me, or is everyone facing that using opencode CLI is consuming more tokens than normally using Claude code CLI ???

balcsida pushed a commit to balcsida/opencode that referenced this pull request Apr 8, 2026
rbasto1 added a commit to rbasto1/opencode that referenced this pull request Apr 14, 2026
xywsxp pushed a commit to xywsxp/opencode that referenced this pull request Apr 24, 2026
Rwanbt pushed a commit to Rwanbt/unifia that referenced this pull request May 5, 2026

Copy link
Copy Markdown

Is it just me, or is everyone facing that using opencode

Last time I used OpenCode desktop, it consumed WAY more tokens than Zed.

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


Back | FazBrowse Home | New Git URL