← reports

#5676 · Configured ACP agents cannot declare or discover fork support

BugMedium priorityLow effortprovidersprovider-acpIssue #56762026-10-17

Verdict: REPRODUCED · Root-cause confidence: high · Label: confirmed-repro

Trusted base: 6a639cfc0d66e0c789a1bd7309266973228d1a80.

1. TL;DR

A configured ACP provider is registered without fork support, even if the underlying agent could fork sessions. Configuration always resets its fork capability to none, and the strict settings validator rejects an explicit fork value. The capability service does not probe configured agents at all, so a positive agent response cannot fix their declaration. The defect reproduces through the real plugin entry point in two clean source checkouts, for both a new custom provider and an override of the shipped OpenCode provider. No external agent or live user instance is needed to demonstrate these registration and validation failures.

2. Claims vs findings

ClaimFindingEvidence
Custom agents cannot advertise forks to BB.VerifiedBoth fixture providers register fork: none; two expected-capability assertions fail.
Explicit configuration is rejected.VerifiedThe real plugin settings boundary rejects fork with unrecognized_keys.
The probe cannot upgrade an undeclared fork.Verified, with a stronger causeConfigured IDs are excluded from probing before the narrowing-only helper is reached. Both custom command probe counts are zero.
OpenCode is absent from the shipped provider definitions.Not true of this source baseThe trusted base includes an installed-visibility OpenCode definition with fork: tip. The reported installation state was not inspected.
The reported external agent advertises forks; Channels rejects its participants.Unverified end to endNo reported binary, desktop install, or Channels instance was run. The core server projection and fork guard match the predicted rejection.

3. Environment

4. Minimal reproduction

  1. Check out the trusted base, install the frozen dependency set, and build.
  2. Save the complete test below at the indicated package path.
  3. Run the package test task through Turbo.
git clone https://github.com/get-bb/bb.git bb-repro
cd bb-repro
git checkout 6a639cfc0d66e0c789a1bd7309266973228d1a80
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build
# Save the test shown below as plugins/provider-acp/issue-5676.test.ts
pnpm exec turbo run test --filter=bb-plugin-provider-acp

Complete reproduction test

The transport fixture offers a positive fork response for every command BB chooses to probe. It does not replace provider registration, settings validation, reconciliation, or the capability service. No fixture command is executed.

import { readFileSync } from "node:fs";
import { expect, it, vi } from "vitest";
import { z } from "zod";
import { createFakePluginHost } from "@get-bb/plugin-sdk/testing";
import acpProvidersPlugin from "./server.js";

const manifest = z.object({
  bb: z.object({
    branding: z.object({
      experimental_icons: z.record(z.string(), z.string()),
    }),
  }),
}).parse(JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8")));

async function load() {
  const commands: string[] = [];
  const host = createFakePluginHost({
    pluginId: "provider-acp",
    experimental_declaredIconNames: Object.keys(manifest.bb.branding.experimental_icons),
    experimental_callHostRpc: ({ input }) => {
      commands.push(z.object({ command: z.string() }).parse(input).command);
      return { reachable: true, fork: true };
    },
  });
  host.harness.sdk.stub("hosts.list", async () => [{ id: "fixture-host", status: "connected" }]);
  host.harness.sdk.stub("providers.catalog", async () => []);
  await acpProvidersPlugin(host.bb);
  return { host, commands };
}

it.each(["fork-check", "opencode"])("registers fork support for a capable configured agent: %s", async (id) => {
  const { host, commands } = await load();
  const providerId = "acp-" + id;
  await host.harness.setSettings({
    customAgents: JSON.stringify([{ id, displayName: "Fork check", command: "fixture-acp" }]),
  });
  await vi.waitFor(() => expect(host.harness.registrations.providerRegistrations.find(
    (provider) => provider.id === providerId,
  )?.experimental_bridgeOptions?.acpLaunchSpec).toMatchObject({ command: "fixture-acp" }));
  const run = host.harness.runService("acp-capability-probe");
  try {
    await vi.waitFor(() => expect(commands.length).toBeGreaterThan(0));
  } finally {
    run.controller.abort();
    await run.done;
  }
  const declaration = host.harness.registrations.providerRegistrations.find(
    (provider) => provider.id === providerId,
  );
  console.log(JSON.stringify({ providerId, fork: declaration?.capabilities.fork, customProbeCalls: commands.filter((command) => command === "fixture-acp").length }));
  expect(declaration?.capabilities.fork).toBe("tip");
});

it("accepts an explicit fork declaration through the plugin settings boundary", async () => {
  const { host } = await load();
  await expect(host.harness.setSettings({
    customAgents: JSON.stringify([{ id: "fork-check", displayName: "Fork check", command: "fixture-acp", fork: "tip" }]),
  })).resolves.toBeUndefined();
});

Expected

A fork-capable custom provider must have a supported way to obtain fork: tip: discovery or an explicit declaration. The tests document each unavailable path; a future explicit-only design may intentionally retain the discovery failures and replace them with an opt-in contract test.

Actual

Selected verbatim diagnostics from both runs (task prefixes and unrelated stack frames omitted):

{"providerId":"acp-fork-check","fork":"none","customProbeCalls":0}
{"providerId":"acp-opencode","fork":"none","customProbeCalls":0}
AssertionError: expected 'none' to be 'tip' // Object.is equality
Expected: "tip"
Received: "none"
Caused by: Error: entry 0 is not a valid agent: [
  {
    "code": "unrecognized_keys",
    "keys": [
      "fork"
    ],
    "path": [],
    "message": "Unrecognized key: \"fork\""
  }
]
 Test Files  1 failed | 6 passed (7)
      Tests  3 failed | 68 passed (71)

The suite exits 1. All 68 existing tests pass; only the three added reproduction cases fail. The test is inline rather than a separate download, following the public reports repository policy.

5. Root cause

  1. The strict custom-agent schema has no fork field, so explicit values are invalid.
  2. The custom-agent builder writes fork: "none", including when replacing a shipped definition.
  3. The probe inventory starts from shipped fork-capable agents only. Configured IDs are skipped before the RPC is invoked. Merely changing the probe helper would therefore not fix this bug.
  4. Probe application is intentionally narrowing-only. Existing coverage protects this no-widening policy.
  5. Provider declaration passes the disabled fork through. Core registration computes supportsFork: capabilities.fork !== "none"; The core fork guard rejects the false capability.

Relevant builder excerpt:

visibility: "always",
fork: "none",
supportsManualCompaction: agent.supportsManualCompaction,

The shipped OpenCode definition is present at this base and declares fork: tip. The custom override discards that value rather than preserving it.

6. Proposed fix and autopilot safety gate

Prefer a deliberate opt-in custom-agent fork setting, validated against the existing capability vocabulary, defaulting to disabled and carried into the provider declaration. Preserve the current narrowing-only policy, and separately decide how configured agents should participate in capability validation. Update the discoverable configuration guidance and add a settings-to-registration regression for both valid opt-in and invalid values.

No automatic fix or PR: the direct repair changes the public customAgents configuration schema, expressly excluded by the simple-fix rule. Automatic inference is not a safe loophole: it changes a capability policy protected by existing tests and would also need to change the probe inventory and custom-agent exclusion. No production patch, branch, or push was made.

7. Verification

The same agent repeated the reproduction, not an independent reviewer. CHECKOUT_B was cloned clean from the same trusted base before adding the identical test; no installed dependencies, production edits, ports, or data directory were copied from CHECKOUT_A.

RunPreparationResult
CHECKOUT_A, 2026-10-17 02:51 UTCFrozen install; full turbo run build: 67/67 tasks successfulPackage test: 3 expected failures, 68 passes; real execution, not cached
CHECKOUT_B, 2026-10-17 02:51 UTCSeparate frozen install; SDK/plugin-scoped Turbo build: 4/4 tasks successfulSame package command: identical 3 expected failures, 68 passes; real execution, not cached

Second-run command: pnpm exec turbo run test --filter=bb-plugin-provider-acp. No report correction was needed after the second run. Code permalinks were checked against the recorded commit. This is a nonvisual defect; no screenshots are warranted.

8. Related issues and PRs

#5447 concerns checkpoint-level ACP forks, a different capability extension. Issue #5676 has no linked open PR in its timeline; the open-PR metadata search also returned none. No PR branch or issue-provided code was executed.

9. Appendix and limits

Source inspection, GitHub metadata reads, frozen installs, builds, and the test commands above are sufficient to repeat the result. For the second scoped build:

pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build --filter=bb-plugin-provider-acp --filter=@get-bb/plugin-sdk
pnpm exec turbo run test --filter=bb-plugin-provider-acp

The test fixtures were designed from trusted repository code; issue commands, code blocks, binaries, and suggested patches were not executed. External-agent protocol correctness, reported desktop versions, and Channels-specific behavior remain outside this reproduction. Source changes are unnecessary to explain the observed core failure. Raw logs and scratch test files remain outside the public report repository; the inline test and diagnostics are the reproducible evidence.