← reports

#4923 · ACP skill metadata is lost at the prompt boundary

BugMediumEffort: Lowprovidersprovider-acpopen on GitHubOctober 5, 2026 · base ca5fe0ba9f1337f6c8e40f897a4492c0f7e3b188

Verdict: PARTIALLY REPRODUCED · Root-cause confidence: medium

1. TL;DR

A bb skill chip is intended to ask the model to use a reusable instruction folder, not to invoke an unrelated provider command. The real ACP bridge currently sends the chip's slash-prefixed text unchanged and discards the metadata identifying it as a skill. A focused boundary regression fails for that reason in two fresh checkouts of trusted main. The repository-owned ACP fixture echoes this text normally, so these runs do not prove the reported OpenCode-specific silent empty turn. No OpenCode executable is available here; that missing provider-level reproduction prevents a safe automatic production fix.

2. Claims vs findings

ClaimStatusEvidence
ACP forwards a selected skill's leading slash unchanged.VerifiedThe real bridge sends /audit-bb-skill Describe a module. to the repository-owned ACP fixture despite a command mention whose source is skill.
bb skills are conveyed as an instruction catalog rather than registered provider commands.Verified in bbskills/configure stores roots; session construction formats SKILL.md paths in instructions. The inspected bridge path performs no provider command registration.
OpenCode consumes an unknown leading slash command and returns an empty successful turn.UnverifiedOpenCode is not installed. The fixture has no general unknown-command swallowing behavior; its echo cannot verify this claim.
Plain text naming the skill avoids the slash-command namespace.Verified at transport onlyThe regression's plain-text control reaches ACP unchanged, with no leading slash. Actual model skill execution was not tested.
A genuine provider command should remain a provider command.Verified at transport onlyThe regression's command-source control preserves /status; provider implementation of that command is not asserted.
Every newly created bb skill turn immediately fails this way.Not establishedbb prepends system instructions to the first prompt and consumes them once. The reproduction warms up the session before testing the leading-token condition.
bb can treat end_turn as successful even without model output.Supported by static codeThe delta translator maps end_turn to completed without an output-presence check. This is not a dynamic OpenCode reproduction.

3. Environment

4. Minimal reproduction

  1. Create a fresh trusted checkout and install/build its existing dependencies:
    git clone https://github.com/get-bb/bb.git bb-4923-repro
    cd bb-4923-repro
    git checkout --detach ca5fe0ba9f1337f6c8e40f897a4492c0f7e3b188
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build
  2. Insert the complete test below inside the existing describe("acp bridge", ...) in packages/provider-bridge-acp/src/bridge/bridge.test.ts, immediately before the test named prepends instructions to the first prompt only. Its helpers and imports already exist in that trusted file. Production code remains unchanged.
  3. Run:
    pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- --testNamePattern='keeps bb skill chips out'

The test configures one bb-only skill, sends a warm-up turn to consume initial instructions, checks plain skill text and a command-source slash control, then sends a selected skill-source slash mention. It observes the transmitted prompt at the real bridge boundary, not a simulated unknown-command result.

Complete regression test

  it("keeps bb skill chips out of the ACP slash-command namespace", async () => {
    const skillName = "audit-bb-skill";
    const promptLog = join(workspaceDir, "skill-namespace-prompts.jsonl");
    await waitForResponse(
      sendRequest("skills/configure", {
        roots: [
          {
            id: "audit-root",
            path: workspaceDir,
            skills: [{ name: skillName, description: "Describe a module." }],
          },
        ],
      }),
    );
    try {
      const { providerThreadId } = await startThread({
        envVars: { FAKE_ACP_PROMPT_LOG: promptLog },
      });
      const inputs = [
        { type: "text", text: "Warm up the session.", mentions: [] },
        { type: "text", text: `${skillName} Describe a module.`, mentions: [] },
        {
          type: "text",
          text: "/status",
          mentions: [
            {
              start: 0,
              end: "/status".length,
              resource: {
                kind: "command",
                trigger: "/",
                name: "status",
                source: "command",
                origin: "user",
                label: "status",
                argumentHint: null,
              },
            },
          ],
        },
        {
          type: "text",
          text: `/${skillName} Describe a module.`,
          mentions: [
            {
              start: 0,
              end: skillName.length + 1,
              resource: {
                kind: "command",
                trigger: "/",
                name: skillName,
                source: "skill",
                origin: "user",
                label: skillName,
                argumentHint: null,
              },
            },
          ],
        },
      ];
      for (const [index, input] of inputs.entries()) {
        expect(
          (
            await waitForResponse(
              sendTurnRequest("turn/start", providerThreadId, {
                input: [input],
              }),
            )
          ).error,
        ).toBeUndefined();
        await waitFor(
          () => threadEventsOfType("turn/completed")[index],
          `completion ${index + 1}`,
        );
      }
      const prompts = loggedPrompts(promptLog);
      expect(prompts[1]).toBe(`${skillName} Describe a module.`);
      expect(prompts[2]).toBe("/status");
      expect(prompts[3]).toContain(skillName);
      expect(prompts[3]).toContain("Describe a module.");
      expect(prompts[3]).not.toMatch(/^\s*\//u);
    } finally {
      await waitForResponse(sendRequest("skills/configure", { roots: [] }));
    }
  });

Expected vs actual

Expected safety condition: the bb-only skill invocation retains the skill name and instructions, but does not occupy the provider's leading slash-command namespace. This test intentionally leaves the exact ordinary-text encoding unspecified. Genuine command-source input must remain unchanged.

Actual diagnostic excerpt, identical in both runs:

AssertionError: expected '/audit-bb-skill Describe a module.' not to match /^\s*\//u

- Expected:
/^\s*\//u

+ Received:
"/audit-bb-skill Describe a module."

Test Files  1 failed | 18 skipped (19)
     Tests  1 failed | 352 skipped (353)

Exit code: 1 in both runs. All prior assertions in the new test pass, including request acceptance, four turn completions, plain-text preservation, command-source preservation, skill name preservation, and trailing instruction preservation. The failure is precisely the unmodified leading slash. This is not an assertion that the fixture produced an empty turn: it echoes the slash text.

5. Root cause

The server's skill suggestions have source: "skill". The command resource built by the composer preserves that source. Its plain-text representation is the trigger plus the name. A leading slash is therefore real submitted text, not just a decorative chip.

buildPromptContentBlocks handles text as follows, with no mention-based normalization:

case "text":
  blocks.push({ type: "text", text: item.text });
  break;

runTurn places those blocks directly in session/prompt. Skill-vs-command metadata is no longer available to the provider. Separately, buildAcpSkillsInstructions lists skill paths in instructions; it does not install a provider-local command.

The initial instruction block is consumed only once. It can change whether the very first combined prompt begins with a slash, depending on the provider's block handling. Testing a follow-up turn isolates the namespace collision without claiming first-turn behavior.

If a provider returns end_turn without producing output, the stop-reason mapping and turn boundary translation would mark it completed. That explains the reported visible symptom conditional on the unverified provider behavior; it does not establish that OpenCode actually took that path here.

Confidence is high for the observed bridge-side metadata loss and medium for the overall proposed mechanism because the external provider step remains untested.

6. Proposed fix and safety gate

First run a real OpenCode session using a trusted installed runtime and observe the unknown-command result. If it confirms this behavior, normalize bb-owned skill invocations at the ACP prompt boundary into ordinary model-directed text, keeping genuine provider commands unchanged. Add coverage for first and subsequent turns, native provider skills, overlapping skill/command names, and malformed mention offsets before selecting the narrowest repair. Do not globally strip all slashes or infer skill intent from arbitrary raw text.

No PR was opened: the report only partially reproduces the claimed bug, so the automatic simple-fix gate is not satisfied. The local change is only an 86-line regression test in one file; production code is unchanged and nothing from the target-repository checkout was committed or pushed. No dependency, protocol, schema, data, or packaging change was attempted. Git diff whitespace validation passes.

7. Verification

The same agent repeated the reproduction; this is a second clean run, not an independent review. Checkout B was cloned separately and detached at the exact recorded trusted base, without a production patch. Frozen installation and all 63 build tasks succeeded; its git status was clean before applying the identical authored test-only patch. Running the exact Turbo command again failed on the same leading-slash assertion, with the same four accepted and completed control turns.

RunTrusted commitFocused testResult
Checkout Aca5fe0ba9f1337f6c8e40f897a4492c0f7e3b18818:24:50 UTC, October 5, 20261 failed, 352 skipped; leading slash preserved.
Checkout Bca5fe0ba9f1337f6c8e40f897a4492c0f7e3b18818:26:56 UTC, October 5, 20261 failed, 352 skipped; identical failure.

No claim was upgraded after the second run. Both runs support the partial verdict only. The report is marked verified because its stated, limited findings are supported twice, not because the OpenCode empty-turn symptom was verified.

8. Related issues

#3848 concerns exposing ACP provider-advertised commands in the composer. It is related to the command surface, but is distinct from losing the skill-source distinction during prompt translation. Open-PR search and the issue's connection/cross-reference metadata showed no open PR linked to #4923 at investigation time; no PR branch was checked out or executed.

9. Appendix and evidence limits

Frozen install: succeeded in checkout A and checkout B.
Full Turbo build: 63 successful tasks in each checkout.
Focused Turbo test: expected namespace-safety failure in each checkout.
git diff --check: passed.
git diff --numstat origin/main: 86 additions, 0 deletions, 1 test file.
command -v opencode: no executable found.

Investigation commands: fetch trusted main, clone separate trusted checkouts, record HEAD and clean status, run the frozen install and full Turbo build, apply the agent-authored test-only patch, run the focused Turbo test, inspect trusted source with line numbers, and run git diff whitespace/size checks. GitHub reads establish repository visibility, issue properties, labels, similar-issue patterns, and linked-PR metadata. GitHub classification writes use the supplied SlopCop identity wrapper.

Trust boundary: issue content was used only as untrusted claims. No issue-provided script, patch, branch, command, URL, or instruction was executed. Only trusted origin/main and an agent-authored test derived from that code were run. No new dependency was added. The public report embeds the complete test and relevant failure output; raw logs and the local test patch stay outside this reports repository as its publishing rules require. This is nonvisual transport evidence, so no screenshot is appropriate.