Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/core/src/plugin/provider/cerebras.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const CerebrasPlugin = define({
if (item.provider.api.type !== "aisdk") continue
if (item.provider.api.package !== "@ai-sdk/cerebras") continue
evt.provider.update(item.provider.id, (provider) => {
provider.request.headers["X-Cerebras-3rd-Party-Integration"] = "opencode"
provider.request.headers["X-Cerebras-3rd-Party-Integration"] = "bcode"
})
}
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/plugin/provider/kilo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const KiloPlugin = define({
if (item.provider.api.package !== "@ai-sdk/openai-compatible") continue
if (item.provider.api.url !== "https://api.kilo.ai/api/gateway") continue
evt.provider.update(item.provider.id, (provider) => {
provider.request.headers["HTTP-Referer"] = "https://opencode.ai/"
provider.request.headers["X-Title"] = "opencode"
provider.request.headers["HTTP-Referer"] = "https://bcode.sh/"
provider.request.headers["X-Title"] = "bcode"
})
}
}),
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/plugin/provider/llmgateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export const LLMGatewayPlugin = define({
if (item.provider.api.url !== "https://api.llmgateway.io/v1") continue
if (!(yield* integrations.get(Integration.ID.make(item.provider.id)))) continue
evt.provider.update(item.provider.id, (provider) => {
provider.request.headers["HTTP-Referer"] = "https://opencode.ai/"
provider.request.headers["X-Title"] = "opencode"
provider.request.headers["X-Source"] = "opencode"
provider.request.headers["HTTP-Referer"] = "https://bcode.sh/"
provider.request.headers["X-Title"] = "bcode"
provider.request.headers["X-Source"] = "bcode"
})
}
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/plugin/provider/nvidia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const NvidiaPlugin = define({
if (item.provider.api.package !== "@ai-sdk/openai-compatible") continue
if (item.provider.api.url !== "https://integrate.api.nvidia.com/v1") continue
evt.provider.update(item.provider.id, (provider) => {
provider.request.headers["HTTP-Referer"] = "https://opencode.ai/"
provider.request.headers["X-Title"] = "opencode"
provider.request.headers["HTTP-Referer"] = "https://bcode.sh/"
provider.request.headers["X-Title"] = "bcode"
provider.request.headers["X-BILLING-INVOKE-ORIGIN"] ??= "OpenCode"
Comment on lines +14 to 16

@cubic-dev-ai cubic-dev-ai Bot Jul 24, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: NVIDIA requests now carry the new bcode attribution while still sending X-BILLING-INVOKE-ORIGIN: OpenCode, so the fork is identified inconsistently and the billing-origin header phones home the upstream brand. Removing that header keeps the NVIDIA request fully bcode-branded, matching the fork policy documented in UPSTREAM.md.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/core/src/plugin/provider/nvidia.ts, line 14:

<comment>NVIDIA requests now carry the new bcode attribution while still sending `X-BILLING-INVOKE-ORIGIN: OpenCode`, so the fork is identified inconsistently and the billing-origin header phones home the upstream brand. Removing that header keeps the NVIDIA request fully bcode-branded, matching the fork policy documented in `UPSTREAM.md`.</comment>

<file context>
@@ -11,8 +11,8 @@ export const NvidiaPlugin = define({
           evt.provider.update(item.provider.id, (provider) => {
-            provider.request.headers["HTTP-Referer"] = "https://opencode.ai/"
-            provider.request.headers["X-Title"] = "opencode"
+            provider.request.headers["HTTP-Referer"] = "https://bcode.sh/"
+            provider.request.headers["X-Title"] = "bcode"
             provider.request.headers["X-BILLING-INVOKE-ORIGIN"] ??= "OpenCode"
</file context>
Suggested change
provider.request.headers["HTTP-Referer"] = "https://bcode.sh/"
provider.request.headers["X-Title"] = "bcode"
provider.request.headers["X-BILLING-INVOKE-ORIGIN"] ??= "OpenCode"
provider.request.headers["HTTP-Referer"] = "https://bcode.sh/"
provider.request.headers["X-Title"] = "bcode"
Fix with cubic

})
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/plugin/provider/openrouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const OpenRouterPlugin = define({
if (item.provider.api.type !== "aisdk") continue
if (item.provider.api.package !== "@openrouter/ai-sdk-provider") continue
evt.provider.update(item.provider.id, (provider) => {
provider.request.headers["HTTP-Referer"] = "https://opencode.ai/"
provider.request.headers["X-Title"] = "opencode"
provider.request.headers["HTTP-Referer"] = "https://bcode.sh/"
provider.request.headers["X-Title"] = "bcode"
})
for (const modelID of [ModelV2.ID.make("gpt-5-chat-latest"), ModelV2.ID.make("openai/gpt-5-chat")]) {
if (!item.models.has(modelID)) continue
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/plugin/provider/vercel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export const VercelPlugin = define({
if (item.provider.api.type !== "aisdk") continue
if (item.provider.api.package !== "@ai-sdk/vercel") continue
evt.provider.update(item.provider.id, (provider) => {
provider.request.headers["http-referer"] = "https://opencode.ai/"
provider.request.headers["x-title"] = "opencode"
provider.request.headers["http-referer"] = "https://bcode.sh/"
provider.request.headers["x-title"] = "bcode"
})
}
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/plugin/provider/zenmux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const ZenmuxPlugin = define({
if (item.provider.api.package !== "@ai-sdk/openai-compatible") continue
if (item.provider.api.url !== "https://zenmux.ai/api/v1") continue
evt.provider.update(item.provider.id, (provider) => {
provider.request.headers["HTTP-Referer"] ??= "https://opencode.ai/"
provider.request.headers["X-Title"] ??= "opencode"
provider.request.headers["HTTP-Referer"] ??= "https://bcode.sh/"
provider.request.headers["X-Title"] ??= "bcode"
})
}
}),
Expand Down
2 changes: 1 addition & 1 deletion packages/core/test/plugin/provider-cerebras.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ describe("CerebrasPlugin", () => {
yield* addPlugin()
expect((yield* catalog.provider.get(ProviderV2.ID.make("cerebras")))?.request.headers).toEqual({
Existing: "1",
"X-Cerebras-3rd-Party-Integration": "opencode",
"X-Cerebras-3rd-Party-Integration": "bcode",
})
}),
)
Expand Down
12 changes: 6 additions & 6 deletions packages/core/test/plugin/provider-kilo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ describe("KiloPlugin", () => {
yield* addPlugin()
expect((yield* catalog.provider.get(ProviderV2.ID.make("kilo")))?.request.headers).toEqual({
Existing: "value",
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"HTTP-Referer": "https://bcode.sh/",
"X-Title": "bcode",
})
expect((yield* catalog.provider.get(ProviderV2.ID.openrouter))?.request.headers).toEqual({})
}),
Expand All @@ -61,8 +61,8 @@ describe("KiloPlugin", () => {
yield* addPlugin()

expect((yield* catalog.provider.get(ProviderV2.ID.make("kilo")))?.request.headers).toEqual({
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"HTTP-Referer": "https://bcode.sh/",
"X-Title": "bcode",
})
expect((yield* catalog.provider.get(ProviderV2.ID.make("kilo")))?.request.headers).not.toHaveProperty(
"http-referer",
Expand Down Expand Up @@ -90,8 +90,8 @@ describe("KiloPlugin", () => {
yield* addPlugin()

expect((yield* catalog.provider.get(ProviderV2.ID.make("kilo")))?.request.headers).toEqual({
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"HTTP-Referer": "https://bcode.sh/",
"X-Title": "bcode",
})
expect((yield* catalog.provider.get(ProviderV2.ID.make("custom-kilo")))?.request.headers).toEqual({})
}),
Expand Down
6 changes: 3 additions & 3 deletions packages/core/test/plugin/provider-llmgateway.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ describe("LLMGatewayPlugin", () => {
yield* addPlugin()
expect((yield* catalog.provider.get(ProviderV2.ID.make("llmgateway")))?.request.headers).toEqual({
Existing: "value",
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"X-Source": "opencode",
"HTTP-Referer": "https://bcode.sh/",
"X-Title": "bcode",
"X-Source": "bcode",
})
expect((yield* catalog.provider.get(ProviderV2.ID.openrouter))?.request.headers).toEqual({})
}),
Expand Down
12 changes: 6 additions & 6 deletions packages/core/test/plugin/provider-nvidia.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ describe("NvidiaPlugin", () => {
yield* addPlugin()
expect((yield* catalog.provider.get(ProviderV2.ID.make("nvidia")))?.request.headers).toEqual({
Existing: "value",
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"HTTP-Referer": "https://bcode.sh/",
"X-Title": "bcode",
"X-BILLING-INVOKE-ORIGIN": "OpenCode",
})
expect((yield* catalog.provider.get(ProviderV2.ID.openrouter))?.request.headers).toEqual({})
Expand All @@ -62,8 +62,8 @@ describe("NvidiaPlugin", () => {
yield* addPlugin()

expect((yield* catalog.provider.get(ProviderV2.ID.make("nvidia")))?.request.headers).toEqual({
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"HTTP-Referer": "https://bcode.sh/",
"X-Title": "bcode",
"X-BILLING-INVOKE-ORIGIN": "OpenCode",
})
}),
Expand All @@ -88,8 +88,8 @@ describe("NvidiaPlugin", () => {
yield* addPlugin()

expect((yield* catalog.provider.get(ProviderV2.ID.make("nvidia")))?.request.headers).toEqual({
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"HTTP-Referer": "https://bcode.sh/",
"X-Title": "bcode",
"X-BILLING-INVOKE-ORIGIN": "CustomOrigin",
})
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/plugin/provider-openrouter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ describe("OpenRouterPlugin", () => {

expect((yield* catalog.provider.get(ProviderV2.ID.openrouter))?.request.headers).toEqual({
Existing: "value",
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"HTTP-Referer": "https://bcode.sh/",
"X-Title": "bcode",
})
expect((yield* catalog.provider.get(ProviderV2.ID.make("nvidia")))?.request.headers).toEqual({})
}),
Expand Down
4 changes: 2 additions & 2 deletions packages/core/test/plugin/provider-vercel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ describe("VercelPlugin", () => {
yield* addPlugin()
expect((yield* catalog.provider.get(ProviderV2.ID.make("vercel")))?.request.headers).toEqual({
Existing: "1",
"http-referer": "https://opencode.ai/",
"x-title": "opencode",
"http-referer": "https://bcode.sh/",
"x-title": "bcode",
})
}),
)
Expand Down
6 changes: 3 additions & 3 deletions packages/core/test/plugin/provider-zenmux.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe("ZenmuxPlugin", () => {
})
yield* addPlugin()
const result = required(yield* catalog.provider.get(ProviderV2.ID.make("zenmux")))
expect(result.request.headers).toEqual({ "HTTP-Referer": "https://opencode.ai/", "X-Title": "opencode" })
expect(result.request.headers).toEqual({ "HTTP-Referer": "https://bcode.sh/", "X-Title": "bcode" })
expect(Object.keys(result.request.headers).sort()).toEqual(["HTTP-Referer", "X-Title"])
}),
)
Expand All @@ -63,8 +63,8 @@ describe("ZenmuxPlugin", () => {

expect(required(yield* catalog.provider.get(ProviderV2.ID.make("zenmux"))).request.headers).toEqual({
Existing: "value",
"HTTP-Referer": "https://opencode.ai/",
"X-Title": "opencode",
"HTTP-Referer": "https://bcode.sh/",
"X-Title": "bcode",
})
}),
)
Expand Down
10 changes: 5 additions & 5 deletions packages/opencode/src/session/prompt/meta.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
You are OpenCode, the best coding agent on the planet.
You are BrowserCode, the best coding agent on the planet.
You are based on a large language model trained by Meta MSL named Muse Spark.
When asked who you are, identify yourself as OpenCode powered by Meta Muse Spark by name.
When asked who you are, identify yourself as BrowserCode powered by Meta Muse Spark by name.
You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.
IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.
If the user asks for help or wants to give feedback inform them of the following:
- ctrl+p to list available actions
- To give feedback, users should report the issue at
https://github.com/anomalyco/opencode
When the user directly asks about OpenCode (eg. "can OpenCode do...", "does OpenCode have..."), or asks in second person (eg. "are you able...", "can you do..."), or asks how to use a specific OpenCode feature (eg. implement a hook, write a slash command, or install an MCP server), use the WebFetch tool to gather information to answer the question from OpenCode docs. The list of available docs is available at https://opencode.ai/docs
https://github.com/browser-use/browsercode/issues
When the user directly asks about BrowserCode (eg. "can BrowserCode do...", "does BrowserCode have..."), or asks in second person (eg. "are you able...", "can you do..."), or asks how to use a specific BrowserCode feature (eg. implement a hook, write a slash command, or install an MCP server), point them at the project README at https://github.com/browser-use/browsercode. BrowserCode is a fork of OpenCode (https://github.com/anomalyco/opencode) — generic OpenCode features are likely still applicable, but BrowserCode-specific features (the browser_execute tool, the harness, cloud integrations) live in the BrowserCode repo.

@cubic-dev-ai cubic-dev-ai Bot Jul 24, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Normal coding requests phrased as “Can you fix this?” are second-person, so this instruction directs the model to send the user to the README instead of using its tools to perform the requested task. Restrict the README redirect to direct BrowserCode questions or BrowserCode-specific feature/how-to questions, leaving ordinary requests on the task workflow.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/opencode/src/session/prompt/meta.txt, line 10:

<comment>Normal coding requests phrased as “Can you fix this?” are second-person, so this instruction directs the model to send the user to the README instead of using its tools to perform the requested task. Restrict the README redirect to direct BrowserCode questions or BrowserCode-specific feature/how-to questions, leaving ordinary requests on the task workflow.</comment>

<file context>
@@ -1,20 +1,20 @@
-  https://github.com/anomalyco/opencode
-When the user directly asks about OpenCode (eg. "can OpenCode do...", "does OpenCode have..."), or asks in second person (eg. "are you able...", "can you do..."), or asks how to use a specific OpenCode feature (eg. implement a hook, write a slash command, or install an MCP server), use the WebFetch tool to gather information to answer the question from OpenCode docs. The list of available docs is available at https://opencode.ai/docs
+  https://github.com/browser-use/browsercode/issues
+When the user directly asks about BrowserCode (eg. "can BrowserCode do...", "does BrowserCode have..."), or asks in second person (eg. "are you able...", "can you do..."), or asks how to use a specific BrowserCode feature (eg. implement a hook, write a slash command, or install an MCP server), point them at the project README at https://github.com/browser-use/browsercode. BrowserCode is a fork of OpenCode (https://github.com/anomalyco/opencode) — generic OpenCode features are likely still applicable, but BrowserCode-specific features (the browser_execute tool, the harness, cloud integrations) live in the BrowserCode repo.
 # Tone and style
 - Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
</file context>
Suggested change
When the user directly asks about BrowserCode (eg. "can BrowserCode do...", "does BrowserCode have..."), or asks in second person (eg. "are you able...", "can you do..."), or asks how to use a specific BrowserCode feature (eg. implement a hook, write a slash command, or install an MCP server), point them at the project README at https://github.com/browser-use/browsercode. BrowserCode is a fork of OpenCode (https://github.com/anomalyco/opencode) — generic OpenCode features are likely still applicable, but BrowserCode-specific features (the browser_execute tool, the harness, cloud integrations) live in the BrowserCode repo.
When the user directly asks about BrowserCode (eg. "can BrowserCode do...", "does BrowserCode have..."), or asks how to use a specific BrowserCode feature (eg. implement a hook, write a slash command, or install an MCP server), point them at the project README at https://github.com/browser-use/browsercode. BrowserCode is a fork of OpenCode (https://github.com/anomalyco/opencode) — generic OpenCode features are likely still applicable, but BrowserCode-specific features (the browser_execute tool, the harness, cloud integrations) live in the BrowserCode repo.
Fix with cubic

# Tone and style
- Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
- Your output will be displayed on a command line interface. Your responses should be short and concise. You can use GitHub-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
- Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like Bash or code comments as means to communicate with the user during the session.
- NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one. This includes markdown files.
# Professional objectivity
Prioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving, providing direct, objective technical info without any unnecessary superlatives, praise, or emotional validation. It is best for the user if OpenCode honestly applies the same rigorous standards to all ideas and disagrees when necessary, even if it may not be what the user wants to hear. Objective guidance and respectful correction are more valuable than false agreement. Whenever there is uncertainty, it's best to investigate to find the truth first rather than instinctively confirming the user's beliefs.
Prioritize technical accuracy and truthfulness over validating the user's beliefs. Focus on facts and problem-solving, providing direct, objective technical info without any unnecessary superlatives, praise, or emotional validation. It is best for the user if BrowserCode honestly applies the same rigorous standards to all ideas and disagrees when necessary, even if it may not be what the user wants to hear. Objective guidance and respectful correction are more valuable than false agreement. Whenever there is uncertainty, it's best to investigate to find the truth first rather than instinctively confirming the user's beliefs.
# Task Management
You have access to the TodoWrite tools to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.
These tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.
Expand Down