f7: deeper phone-home / branding sweep

Merged
AL
6mo ago
+107-144

Summary

Deeper sweep of remaining OpenCode brand strings, OpenCode-product upsells, and one real phone-home leak (https://app.opencode.ai web-UI proxy fallback) that the F7 medium pass deferred (PR #12). Per the zone matrix:

  • OpenCode → BrowserCode in user-visible strings only. Internal identifiers (env vars, Effect service IDs, x-opencode-* headers, third-party provider User-Agents, OpenCodeHttpApi Effect class, the "opencode" wire-protocol service name in HttpApi.make) untouched.
  • opencode → bcode in CLI invocations shown to users (tips, toasts, ACP terminal-auth, MCP auth toast, MCP Client.name).

35 files, +102 / −143.

What changed

User-visible identity & instructions

  • System prompts (codex, kimi, gpt, beast, copilot-gpt-5, gemini, trinity): "You are OpenCode" → "You are BrowserCode" with the same fork-acknowledgement wording previously applied to anthropic.txt and default.txt. anthropic.txt's objectivity-section "OpenCode" reflowed to "BrowserCode".
  • TUI sidebar/footer wordmark: "Open|Code" two-tone branding → "Browser|Code". "Getting started" panel line about "OpenCode includes free models" rewritten.
  • TUI tips-view: 14 random-tip strings updated (CLI commands opencode <cmd> → bcode <cmd>, paths ~/.config/opencode/tui.json → ~/.config/bcode/tui.json). Removed three: the docker run ghcr.io/anomalyco/opencode tip, the /opencode GitHub-PR commands (we don't have an equivalent GitHub App), and the "/connect with OpenCode Zen" recommendation.
  • TUI permission dialogs (both TUI and non-TUI bcode run paths): "until OpenCode is restarted" → "until BrowserCode is restarted"; "Tell OpenCode what to do differently" → "BrowserCode".
  • OAuth callback HTML (mcp/oauth-callback.ts + plugin/codex.ts): titles + body text say BrowserCode.
  • TUI app.tsx "Successfully updated to OpenCode v..." → "BrowserCode v..." after bcode upgrade.

Third-party wire identity

  • MCP Client({ name: "opencode" }) → "bcode" (3 sites) so MCP servers log us as bcode.
  • MCP OAuth client_name: "OpenCode" → "BrowserCode" (shown on third-party consent screens).
  • MCP toast "Run: opencode mcp auth ..." → bcode mcp auth.
  • cmd === "opencode" BUN_BE_BUN check accepts both "bcode" and "opencode" so user MCP configs invoking either binary work.
  • ACP agentInfo.name and terminal-auth command/label updated. ACP clients (Zed) now display BrowserCode and invoke bcode auth login for terminal auth.

Server / API surface

  • 20 OpenAPI route descriptions (config, experimental, global, instance, project, pty, session): "the OpenCode X" → "the BrowserCode X". Visible at GET /doc.
  • Real phone-home removed: server/shared/ui.ts previously fell back to proxying every web UI request to https://app.opencode.ai when the embedded UI bundle was missing. BrowserCode now 404s in that case. Removed: UI_UPSTREAM, upstreamURL, requestBody, proxyResponseHeaders, and the HTTP proxy code path. services.client is kept in the signature so the router call-site doesn't change on every upstream sync.

Free-usage / provider upsells

  • bcode models no longer sorts OpenCode's providers first.
  • bcode auth login/providers login: removed opencode: 0 priority bias and opencode: "recommended" hint. Positional-arg description "opencode auth provider" → "well-known auth provider URL".
  • session/retry.ts FreeUsageLimitError sentinel message no longer reads "Subscribe to OpenCode Go ... $5/month"; replaced with a neutral string. GO_UPSELL_URL stays empty so the TUI DialogRetryAction GO-treatment path stays dark (unchanged behavior).
  • "Configure it in opencode.json" prose in two providers.ts prompt blocks → bcode.json.

Misc

  • repo_clone tool description, /init command template, agent.ts reference-scout prompt → BrowserCode.
  • packages/ui/src/assets/favicon/site.webmanifest (symlinked from packages/app/public/site.webmanifest): name + short_name → BrowserCode. Picked up when the web UI is rebuilt.
  • config.ts deprecation log "tui keys in opencode config" → "in bcode config"; "Server configuration for opencode serve" → "bcode serve".

Deliberately NOT changed

  • @opencode-ai/* workspace package names — Red zone.
  • @opencode/... Effect service IDs — Red zone.
  • x-opencode-* HTTP headers, OPENCODE_* env vars — Red zone (wire/config).
  • --user-agent=opencode/... for third-party provider compat — Red.
  • HttpApi.make("opencode") registered service name + OpenCodeHttpApi Effect class — wire-protocol service name; renaming forks the whole HTTP API namespace.
  • .well-known/opencode remote-config endpoint — wire protocol; renaming breaks interop with OpenCode-style remote-config servers.
  • opencode.ai/zen, opencode.ai/go upsell URLs inside the dialog-provider Zen/Go connect dialogs — only shown when a user explicitly picks OpenCode as a provider; in that path they need the URL.
  • dialog-retry-action.tsx GO_URL constant — dead code; message-level neutralization already in place.
  • acp/README.md, control-plane/dev/README.md — dev docs, not bundled.
  • Default theme rename (opencode.json → bcode.json) and channel-DB filename — deferred; high sync-conflict surface for low payoff. Theme rename breaks user tui.json "theme": "opencode"; channel db only fires for non-latest channels we don't ship.

Verification

  • bun run typecheck 6/6 clean (16.3s).
  • OPENCODE_VERSION=0.1.3-f7-deeper-dryrun bun run --cwd packages/opencode build -- --single succeeds. ./bcode --help boots, renders BrowserCode banner, lists commands as bcode <cmd>.

EXCEPTIONS.md (in the agent's memory repo, not this PR per the F2 convention) will be updated post-merge with per-row deferral rationale.