Skip to content

opencode v2: preset BILLION_CONTEXT_PROXY disarms native routing while tools still find the proxy — all tool forwards 404 #886

Closed

Description

@ranxianglei

Repro

  1. Start a bili proxy manually (bili start --port 44765).
  2. Run bare opencode v2 with the plugin installed and BILLION_CONTEXT_PROXY=http://127.0.0.1:44765 preset.
  3. Ask the model to call acp_status.

Symptom

Model traffic goes direct to the upstream (the proxy log never sees the session), while the plugin's tools still discover the proxy through the env: every /plugin/tool forward returns 404 unknown plugin conversation (no model request has arrived with this conversation id yet). The model surfaces the raw error and tells the user to refresh/restart — the exact "ACP never activates, tools are fake" experience reported during v2 testing.

Root cause

nativeBootstrapGate treats a preset BILLION_CONTEXT_PROXY as "a bili launch already owns a proxy" → native bootstrap off. But nothing actually routes the model traffic (no MITM, no config rewrite — those only happen under a real launcher): createNativeRoute runs with origin: undefined and no respawn, so every model-API request silently goes direct. Meanwhile opencode-v2's tool execute() finds the proxy via proxyBaseFromEnv() and forwards — to a proxy that has never seen the conversation.

Fix

planNativeOpencode treats the preset value as an external attach target (probe + rewrite + stamp, same as BILLION_CONTEXT_ATTACH), plus a guided message for the residual never-registered 404. Shipped in #885 (verified end-to-end in all four postures).

Activity

  1. added a commit that references this issue on Oct 1, 2026
  2. added a commit that references this issue on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions