fix(core): rebrand attribution headers and meta prompt introduced by v1.18.4 sync
Summary
Post-sync branding audit of the v1.18.4 window (#116) found two surfaces where sync-introduced upstream code violates established fork policy. Stacked on sync/upstream-v1.18.4.
1. Provider attribution headers (7 files + their tests)
Upstream's new v2 provider-plugin architecture (packages/core/src/plugin/provider/) sets attribution headers per provider, architecturally bypassing the provider/provider.ts sites rebranded in PR #12 (those survived the sync intact). A bcode binary was crediting OpenCode for its traffic:
| File | Change |
|---|---|
zenmux.ts, kilo.ts, openrouter.ts, nvidia.ts, vercel.ts | HTTP-Referer: opencode.ai → bcode.sh, X-Title: opencode → bcode |
llmgateway.ts | same + X-Source: opencode → bcode |
cerebras.ts | X-Cerebras-3rd-Party-Integration: opencode → bcode |
Same rationale as PR #12: attribution is not auth or User-Agent; sending opencode.ai from a bcode binary is impersonation. Red-zone identifiers untouched: openai.ts User-Agent: opencode/<ver> + originator: "opencode" (Codex OAuth provider trust), gitlab.ts/cloudflare-*.ts User-Agents, and plugin/provider/opencode.ts (OpenCode-as-provider, user-initiated) are all left verbatim. provider-opencode.test.ts untouched.
2. New meta.txt system prompt
New in this window (upstream #36122), selected when model.api.id.includes("muse-spark"). Shipped as "You are OpenCode", identified itself as OpenCode, sent feedback to anomalyco/opencode, and instructed the agent to WebFetch opencode.ai/docs when asked about its own features. Rebranded following the default.txt / per-model prompt convention (F7 deeper sweep, PR #63): BrowserCode identity, browser-use/browsercode feedback URL, README pointer with fork acknowledgement.
Also audited, deliberately not changed
bcode consolecommand (new, device-flow login toconsole.opencode.ai): hidden (describe: false), user-initiated only — same deferred class asbcode github.- TUI: only new OpenCode string in the window was the
/sharetip, already handled in #116. - Install/upgrade paths: still exclusively
bcode.sh+browser-use/browsercodereleases.
Verification
- Filtered
bun run typecheck: 16/16 pass bun test test/plugin/provider-*.test.ts(7 affected files, frompackages/core): 30/30 pass
Merge order
#116 → main first, then rebase this onto main (or merge this into the sync branch so #116 carries it — either works, changes are confined to sync-introduced files).
Summary by cubic
Rebranded sync-introduced provider attribution headers and the Muse Spark meta system prompt from OpenCode to BrowserCode/bcode. Prevents opencode.ai attribution from bcode traffic and aligns prompts and links with the fork.
- Bug Fixes
- Updated provider plugins (
cerebras,kilo,llmgateway,nvidia,openrouter,vercel,zenmux) to sendHTTP-Referer: https://bcode.sh/andX-Title: bcode(plusX-Source: bcodefor LLMGateway andX-Cerebras-3rd-Party-Integration: bcodefor Cerebras). - Rebranded
muse-sparkmeta prompt to BrowserCode: new name, feedback URL (browser-use/browsercode/issues), and docs pointer (project README with fork note). - Updated tests to match new headers; kept upstream-required identifiers intact (e.g., OpenAI UA, NVIDIA
X-BILLING-INVOKE-ORIGIN).
- Updated provider plugins (