Skip to content

f7: deeper phone-home / branding sweep#63

Merged
Alezander9 merged 2 commits into
mainfrom
f7/deeper-phone-home-sweep
May 13, 2026
Merged

f7: deeper phone-home / branding sweep#63
Alezander9 merged 2 commits into
mainfrom
f7/deeper-phone-home-sweep

Conversation

@Alezander9
Copy link
Copy Markdown
Member

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:

  • OpenCodeBrowserCode 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.
  • opencodebcode 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.jsonbcode.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.

Catches user-visible OpenCode brand strings, OpenCode-product upsells,
and one real phone-home leak that the medium pass deferred.

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,
  `opencode` as 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).

What changed:

* System prompts: codex / kimi / gpt / beast / copilot-gpt-5 / gemini /
  trinity now identify as BrowserCode (was "You are OpenCode"). Same
  wording previously applied to anthropic.txt / default.txt: name
  BrowserCode first, acknowledge OpenCode lineage, point at the
  BrowserCode repo for fork-specific features. anthropic.txt's
  objectivity section also reflows from OpenCode -> BrowserCode.

* OpenAPI route descriptions (config, experimental, global, instance,
  project, pty, session): 20 sites of "the OpenCode X" -> "the
  BrowserCode X". Visible at `GET /doc` and in SDK type descriptions.

* TUI sidebar/footer wordmark: "Open|Code" two-tone branding watermark
  -> "Browser|Code". The "Getting started" panel rewritten away from
  "OpenCode includes free models".

* TUI tips-view: 14 random-tip strings updated. Renamed `opencode` CLI
  invocations to `bcode`, replaced upstream config-path examples
  (`~/.config/opencode/tui.json`, `opencode.json`) with bcode-flavored
  paths. Removed: tips advertising `docker run ghcr.io/anomalyco/opencode`,
  `/opencode` GitHub commands, and the "/connect with OpenCode Zen"
  recommendation (we don't earn upsells from OpenCode and shouldn't
  steer users to them by default).

* 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 pages (mcp/oauth-callback.ts + plugin/codex.ts):
  titles + body text say BrowserCode. Visible in the user's browser
  after an MCP-server or Codex provider auth flow.

* MCP wire identity: Client({ name: "opencode" }) -> "bcode" (3 sites
  in mcp/index.ts) so MCP servers see us as bcode in client-handshake
  logs; client_name: "OpenCode" -> "BrowserCode" in oauth-provider.ts
  (visible on third-party OAuth consent screens); toast "Run: opencode
  mcp auth ..." -> `bcode mcp auth`; the `cmd === "opencode"` BUN_BE_BUN
  check now matches both "bcode" and "opencode" so user MCP configs
  invoking either binary work.

* ACP agent identity (acp/agent.ts): agentInfo.name and terminal-auth
  command/label updated. ACP clients like Zed display the BrowserCode
  name and invoke `bcode auth login` for terminal auth.

* TUI app.tsx "Successfully updated to OpenCode v..." -> "BrowserCode
  v...". Visible after `bcode upgrade`.

* `bcode models` provider sort: removed the `a.startsWith("opencode")`
  boost that put OpenCode's providers first. Now plain alphabetical.

* `bcode providers login` (= `bcode auth login`): dropped the
  `opencode: 0` priority bias and the `opencode: "recommended"` hint
  in the provider picker. "Configure it in opencode.json" prose in two
  amazon-bedrock / generic-credential prompt blocks -> "bcode.json".
  Positional-arg description "opencode auth provider" -> "well-known
  auth provider URL".

* 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 (dev or OPENCODE_DISABLE_EMBEDDED_WEB_UI).
  BrowserCode now 404s in that case. Removed: UI_UPSTREAM, upstreamURL,
  requestBody, proxyResponseHeaders, and the HTTP proxy code path.
  `services.client` is kept in the function signature so the router
  call-site doesn't need to change on every sync.

* repo_clone tool description + /init command template now say
  BrowserCode; agent.ts reference-scout prompt's "OpenCode materializes
  this configured repository" -> "BrowserCode".

* session/retry.ts: the FreeUsageLimitError upsell message stops saying
  "Subscribe to OpenCode Go ... $5/month"; replaced with a neutral
  "Free usage limit reached on this provider." sentinel. GO_UPSELL_URL
  stays empty so the TUI DialogRetryAction GO-treatment path stays dark
  (unchanged behavior, just wording).

* PWA manifest (ui/src/assets/favicon/site.webmanifest, symlinked from
  app/public/site.webmanifest): name + short_name -> BrowserCode.
  Picked up when the web UI is rebuilt (we don't currently rebuild;
  this is for the eventual upstream-side rebuild).

* config.ts deprecation log "tui keys in opencode config are deprecated"
  -> "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 — Red zone (wire protocol).
* OPENCODE_* env vars — Red zone (user-configurable interface).
* --user-agent=opencode/... for third-party provider compat — Red.
* HttpApi.make("opencode") service name + OpenCodeHttpApi Effect class
  — wire-protocol service name registered on the router; renaming
  would fork the entire HTTP API namespace.
* .well-known/opencode remote-config-server endpoint — wire protocol;
  third-party servers serve config at this conventionally-named path.
  Renaming would break interop with anyone running OpenCode-style
  remote-config servers.
* opencode.ai/zen, opencode.ai/go upsell URLs inside dialog-provider
  Zen/Go connect dialogs — only shown when user explicitly picks
  OpenCode as a provider; in that path they need the URL to get a key.
* dialog-retry-action.tsx GO_URL constant — already neutralized at the
  message level via empty GO_UPSELL_URL; dead code.
* acp/README.md, control-plane/dev/README.md — dev docs, not bundled.
* Renaming default theme opencode.json -> bcode.json and channel-DB
  filename opencode-{channel}.db -> bcode-{channel}.db — deferred.
  Theme rename cascades through ~6 theme.tsx sites and breaks users'
  `tui.json` `"theme": "opencode"`; channel db only fires for
  non-`latest` channels we don't ship. Both increase sync conflict
  surface for little user-facing payoff.

Verification:
* `bun run typecheck` 6/6 clean (16.3s).
* Single-platform build at OPENCODE_VERSION=0.1.3-f7-deeper-dryrun
  succeeds; `./bcode --help` boots, renders BrowserCode banner, lists
  commands as `bcode <cmd>`.
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 35 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/opencode/src/session/retry.ts">

<violation number="1" location="packages/opencode/src/session/retry.ts:87">
P2: This message literal change breaks the existing `session.retry.retryable` expectation for `free_tier_limit`; update downstream assertions/consumers or keep a shared constant to avoid contract drift.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review, or fix all with cubic.

Comment thread packages/opencode/src/session/retry.ts Outdated
Cubic flagged that the inline literal change in retry.ts:87 ("Subscribe
to OpenCode Go ... $5/month" -> "Free usage limit reached on this
provider.") broke retry.test.ts:257 which asserted on the upstream
literal byte-for-byte.

Right fix: shared const, so test and impl reference one symbol and
future BrowserCode-side neutral edits don't need synchronized test
updates. Mirrors the existing GO_UPSELL_MESSAGE / GO_UPSELL_URL
pattern. Added FREE_TIER_ACTION_MESSAGE; test now uses
SessionRetry.FREE_TIER_ACTION_MESSAGE.

The schema-decoding.test.ts inline literal stays — that's a
schema-shape decode/encode round-trip with arbitrary string values,
not an assertion on retry.ts behavior.

Verified: bun typecheck 6/6 clean; retry.test.ts 31/31 pass;
schema-decoding.test.ts 25/25 pass.
@Alezander9 Alezander9 merged commit de1d917 into main May 13, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant