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 |
This reverts commit 1ac1a02.
|
Worth considering: https://en.wikipedia.org/wiki/Code_as_speech |
This reverts commit 1ac1a02.
|
clwnd is now rolled out as well, uses 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. |
|
@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. |
|
@cedws 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. |
This reverts commit 1ac1a02.
This reverts commit 1ac1a02.
|
How is blackbox able to offer Claude code and Claude models within their harness? |
This reverts commit 1ac1a02.
|
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 It would be nice to see Claude in OpenCode again, OpenCode is far superior to Claude Code CLI. |
|
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 |
This reverts commit 1ac1a02.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
@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 |
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 的文档信息
This reverts commit 1ac1a02.
This reverts commit 1ac1a02.
This reverts commit 1ac1a02.
This reverts commit 1ac1a02.
This reverts commit 1ac1a02.
还原官方因法律请求移除的 Anthropic 相关功能: - 恢复 opencode-anthropic-auth 内置插件 - 恢复 claude-code-20250219 beta header - 恢复 anthropic prompt 文件 - 恢复 provider 登录提示 - 恢复文档中的 OAuth 订阅说明
Remove anthropic references per legal requests: