anthropic legal requests - #18186
Conversation
Greptile SummaryThis PR removes Anthropic-specific references from the codebase per legal requirements, including the branded system prompt file, the Key changes:
Issues found:
Confidence Score: 3/5
Important Files Changed
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
|
| 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, | ||
| }), |
There was a problem hiding this comment.
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:
| 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}`, | |
| }), |
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 |
|
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 |
This reverts commit 1ac1a02.
This reverts commit 1ac1a02.
|
@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 |
|
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 |
|
Worth considering: https://en.wikipedia.org/wiki/Code_as_speech |
|
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 |
There was a problem hiding this comment.
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" |
- 恢复 providers.ts 中的 Anthropic 认证提示 - 恢复 llm.ts 中对 Anthropic 提供者的请求头处理 - 恢复 anthropic-20250930.txt 提示文件 - 恢复 providers.mdx 中关于 Anthropic 的文档信息
还原官方因法律请求移除的 Anthropic 相关功能: - 恢复 opencode-anthropic-auth 内置插件 - 恢复 claude-code-20250219 beta header - 恢复 anthropic prompt 文件 - 恢复 provider 登录提示 - 恢复文档中的 OAuth 订阅说明
This reverts commit 1ac1a02.
|
Is it just me, or is everyone facing that using opencode CLI is consuming more tokens than normally using Claude code CLI ??? |
This reverts commit 1ac1a02.
Last time I used OpenCode desktop, it consumed WAY more tokens than Zed. |
Remove anthropic references per legal requests: