Skip to content

internal error when use omp Agent #1918

Closed

Description

@aiyi404

The work

ACP threads fail to start: bb-bridge MCP server is spawned with the bridge worker script instead of the plugin entry point

Environment

  • bb: 0.39.0 (macOS, Apple Silicon, Electron distribution)
  • Affected provider: acp-omp (and likely every other acp-* provider — the faulty code path is in the shared provider-acp bridge)
  • ACP agent: omp (oh-my-pi) 17.3.7, via Homebrew
  • OS: macOS (darwin-arm64)

Summary

Starting a new thread with any ACP provider fails at thread.start with a generic
Command thread.start failed / Internal error.

Root cause: when the provider-acp bridge builds the bb-bridge dynamic-tool MCP
server config, resolveBridgeProcessArgsForMcpServer() uses process.argv[1] as the
entry point. Because the plugin now runs inside the generic
bb-provider-bridge-worker.mjs, process.argv[1] resolves to the worker script, not
the plugin's host.js. The spawned "MCP server" is therefore launched without the
arguments the worker expects (plugin host path, plugin id, data dir), exits immediately,
and the ACP agent rejects session/new with bb-bridge: Transport closed.

Steps to reproduce

  1. Install bb 0.39.0 and an ACP agent (e.g. omp, which exposes omp acp).
  2. Create a new thread with provider acp-omp and any model.
  3. thread.start fails with Internal error.

Expected vs actual

  • Expected: the thread starts; the bb-bridge MCP server (used for the built-in
    update_environment_directory dynamic tool) is spawned from the plugin's own
    host.js --mcp-stdio.
  • Actual: bb spawns:
{
  "name": "bb-bridge",
  "command": "/Applications/bb.app/Contents/MacOS/bb",
  "args": [
    "/Applications/bb.app/Contents/Resources/app.asar.unpacked/node_modules/bb-app/host-daemon/dist/bb-provider-bridge-worker.mjs",
    "--mcp-stdio"
  ]
}

Note args[0] is the worker, which requires <host.js> and
does not handle --mcp-stdio. It exits immediately, so the agent's
session/new fails.

Evidence

Traced ACP traffic between the bridge and omp acp shows session/new being rejected:

{"jsonrpc":"2.0","id":2,"error":{"code":-32603,"message":"Internal error","data":{"details":"bb-bridge: Transport closed"}}}

bb surfaces only the top-level message (Internal error); data.details is dropped,
which made this hard to diagnose from the UI.

Control experiments (same machine, same omp 17.3.7):

  • omp acp driven directly over ACP (initialize → session/new →
    session/set_config_option → session/prompt) works, including two concurrent
    sessions on the same model — so this is not an agent-side or concurrency limit.
  • Replaying the exact session/new with the MCP args corrected to
    [host.js, "--mcp-stdio"] succeeds (session/new ok, model switch ok).
  • Replaying it with the worker script as the entry point reproduces
    bb-bridge: Transport closed.

Whether the failure surfaces on the first session of a bridge process appears
timing-dependent (we observed one first-session success, then deterministic failures
on subsequent sessions), which matches reports of "one thread works, new threads fail".

Root cause

plugins/provider-acp/src/bridge/tool-proxy-mcp.ts:

function resolveBridgeProcessArgsForMcpServer() {
 const entryPoint = process.argv[1]
   ? resolve(process.argv[1])
   : fileURLToPath(import.meta.url);
 return [...process.execArgv, entryPoint, "--mcp-stdio"];
}

process.argv[1] is only the plugin entry when the plugin runs standalone. Under the
current architecture the daemon launches
bb bb-provider-bridge-worker.mjs <host.js> , so argv[1] is the
worker script. This looks like a regression from the bridge-worker refactor.

Suggested fix

Use the module URL unconditionally — it always points at the plugin bundle:

function resolveBridgeProcessArgsForMcpServer() {
 return [...process.execArgv, fileURLToPath(import.meta.url), "--mcp-stdio"];
}

Additional issues worth fixing alongside

  1. Error details are swallowed. The agent returns
    error.data.details: "bb-bridge: Transport closed", but neither the UI nor
    host-daemon.log surfaces it — both show only Internal error. Please propagate
    error.data into the thread error and daemon logs.
  2. This affects every acp-* provider, not just acp-omp: buildSessionMcpServers()
    is shared, so any agent that rejects a failed MCP server at session/new will fail
    the same way.

Regression note

ACP threads with the same agent worked before the bb 0.39.0 update on this machine;
the first failure timestamps appear immediately after the update.

Why now

ACP threads fail to start: bb-bridge MCP server is spawned with the bridge worker script instead of the plugin entry point

Acceptance criteria

open a new thread use omp

Activity

  1. suiramdev commented on Aug 19, 2026

    @suiramdev

    Same here 😢

  2. added theissue type on Aug 19, 2026
  3. added
    providers
    provider-acp
    omp
    on Aug 19, 2026
  4. SawyerHood commented on Aug 19, 2026

    @SawyerHood
    Collaborator

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1918.html

    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause (short): plugins/provider-acp/src/bridge/bridge.ts resolveBridgeProcessArgsForMcpServer() uses process.argv[1] as the bb-bridge MCP server entry, but since Agent providers as a first-class plugin surface (provider bridge protocol) #1640 (0.39.0) argv[1] is the provider-bridge bootstrap (bb-provider-bridge-worker.mjs / bridge-worker-entry.ts), so the MCP child exits 1 with a usage error and omp rejects session/new with "bb-bridge: Transport closed" (surfaced only as "Internal error" because agent-connection.ts drops error.data).
    • Proposed fix: In plugins/provider-acp/src/bridge/bridge.ts replace resolveBridgeProcessArgsForMcpServer() body with return [...process.execArgv, fileURLToPath(import.meta.url), "--mcp-stdio"]; (the bridge's own module URL is the artifact in every launch mode; argv[1] is always the bootstrap now). Verified: repro test fails on d81fee6 and passes with the change, full provider-acp suite (162 tests) and typecheck pass, and an acp-omp thread on the dev instance gets past thread/start. No wire change, so no HOST_DAEMON_PROTOCOL_VERSION bump. Keep a test that actually executes the advertised MCP command (the e…
    • Caveats: omp is not installed on this machine; I installed @oh-my-pi/[email protected] plus bun 1.3.14 under /tmp for the repro (issue used 17.3.7 on macOS/Electron; my repro is Linux from source, where argv[1] is bridge-worker-entry.ts instead of bb-provider-bridge-worker.mjs — same mechanism). With the fix applied, the omp turn still fails with "Internal error" in my sandbox because omp has no model…

    The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at the base commit, and repro artifacts. It was independently re-run by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Opus 5

  5. added
    confirmed-repro
    on Aug 19, 2026
  6. self-assigned this
    on Aug 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

confirmed-reproompprovider-acpproviders

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions