All reports

#7585 · ACP running presentation misses delayed arguments

BugPriority: LowEffort: Lowproviders · provider-acp

2026-11-15 · Issue · trusted base da3e60b81d560e114a2bec724bb59c997aaaae7f

Verdict: REPRODUCED · Root-cause confidence: high · reproduction label: confirmed-repro

1. Summary

ACP tools may announce a read or search before they supply its arguments. bb correctly classifies the later arguments, but it does not publish the changed presentation for the running item. Consumers therefore retain the announcement title until completion. Six focused cases reproduce this at the real ACP translator and shared event assembler boundary, with and without simultaneous output. The same agent repeated the failure in a second clean checkout of trusted main.

2. Claims versus findings

ClaimFindingEvidence
Delayed read paths do not refresh the running row.Verified at event boundaryBoth read cases lack an item/started refresh; expected title entry.ts.
Delayed path and content search arguments behave similarly.Verified at event boundaryFour search cases lack the refresh; expected titles **/*.spec.ts and needle.
Argument classification is available; the refresh is command-specific.VerifiedThe read/search classifiers accept the arguments, while the nonterminal refresh gate requires command on both sides.
Command refresh already works.Verified by existing regression suiteThe existing command-refresh cases pass after the focused repair; command logic remains unchanged.
Specific live provider, plugin version, Windows UI wording.Not exercisedNo model, third-party plugin, Windows installation, or browser session was run. This report establishes the core protocol defect, not a live-provider screenshot.

3. Environment

4. Minimal reproduction

  1. Create a trusted base checkout:
    git clone --branch main https://github.com/get-bb/bb.git bb-7585
    cd bb-7585
    git checkout --detach da3e60b81d560e114a2bec724bb59c997aaaae7f
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build --filter=@bb/provider-bridge-acp
  2. Save the regression source below to packages/provider-bridge-acp/src/late-input.test.ts.
  3. Run:
    pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/late-input.test.ts

Each case opens a turn, announces an argument-free read or search, and sends the arguments in a nonterminal update. It expects a new running presentation with the same item identity and original semantic shape. A second argument update verifies that the original shape remains intact across multiple refreshes; completion must still emit both the original tool completion and its specialized read/search completion.

Expected: Six cases pass. Each update publishes the current basename or query without changing the running item's semantic type. Output is preserved, unchanged updates stay silent, and the two-shape completion contract is preserved.

Actual on trusted main: all six cases fail at the first missing refresh. The initial item exists and is a toolCall; the subsequent item/started event is absent. Representative verbatim assertion and test totals:

AssertionError: expected undefined to match object { item: { type: 'toolCall', …(4) } }
Test Files  1 failed (1)
     Tests  6 failed (6)
Full self-contained regression source
import { describe, expect, it } from "vitest";
import { createDeltaAssembler } from "@bb/provider-bridge-protocol/assembler";
import {
  ACP_TURN_STARTED_METHOD,
  ACP_UPDATE_METHOD,
} from "./bridge-protocol.js";
import { createAcpDeltaTranslator } from "./delta-translation.js";

describe.each([
  {
    name: "file read",
    kind: "read",
    input: { path: "lib/entry.ts" },
    title: "entry.ts",
    nextInput: { path: "lib/other.ts" },
    nextTitle: "other.ts",
    completedType: "fileRead",
  },
  {
    name: "path search",
    kind: "search",
    input: { glob: "**/*.spec.ts", path: "/workspace/lib" },
    title: "**/*.spec.ts",
    nextInput: { glob: "**/*.json", path: "/workspace/lib" },
    nextTitle: "**/*.json",
    completedType: "search",
  },
  {
    name: "content search",
    kind: "search",
    input: { pattern: "needle", path: "/workspace/lib" },
    title: "needle",
    nextInput: { pattern: "another needle", path: "/workspace/lib" },
    nextTitle: "another needle",
    completedType: "search",
  },
])("ACP late input: $name", (sample) => {
  it.each([undefined, "partial result"])(
    "refreshes presentation without replacing the running shape (output=%s)",
    (output) => {
      const translator = createAcpDeltaTranslator({ cwd: "/workspace" });
      const assembler = createDeltaAssembler({
        providerId: "acp",
        progressThrottleMs: 0,
      });
      const translate = (update: Record<string, unknown>) =>
        assembler.assemble({
          threadId: "late-input-thread",
          deltas: translator.translateAcpEvent(
            {
              jsonrpc: "2.0",
              method: ACP_UPDATE_METHOD,
              params: { threadId: "late-input-thread", update },
            },
            { threadId: "late-input-thread" },
          ),
        });
      assembler.assemble({
        threadId: "late-input-thread",
        deltas: translator.translateAcpEvent({
          jsonrpc: "2.0",
          method: ACP_TURN_STARTED_METHOD,
          params: { threadId: "late-input-thread" },
        }),
      });
      const initial = translate({
        sessionUpdate: "tool_call",
        toolCallId: "late-input-call",
        kind: sample.kind,
        title: sample.kind,
        status: "pending",
      }).find((event) => event.type === "item/started");
      expect(initial?.item.type).toBe("toolCall");

      const update = {
        sessionUpdate: "tool_call_update",
        toolCallId: "late-input-call",
        status: "in_progress",
        rawInput: sample.input,
      };
      const refreshed = translate({ ...update, rawOutput: output });
      expect(
        refreshed.find((event) => event.type === "item/started"),
      ).toMatchObject({
        item: {
          ...initial?.item,
          presentation: expect.objectContaining({ title: sample.title }),
        },
      });
      if (output !== undefined) {
        expect(refreshed).toContainEqual(
          expect.objectContaining({
            type: "item/toolCall/progress",
            itemId: initial?.item.id,
            message: output,
          }),
        );
      }
      expect(translate(update)).toEqual([]);

      expect(
        translate({ ...update, rawInput: sample.nextInput }).find(
          (event) => event.type === "item/started",
        ),
      ).toMatchObject({
        item: {
          ...initial?.item,
          presentation: expect.objectContaining({ title: sample.nextTitle }),
        },
      });
      const completed = translate({
        sessionUpdate: "tool_call_update",
        toolCallId: "late-input-call",
        status: "completed",
      });
      expect(completed).toEqual(
        ["toolCall", sample.completedType].map((type) =>
          expect.objectContaining({
            type: "item/completed",
            item: expect.objectContaining({
              id: initial?.item.id,
              type,
              presentation: expect.objectContaining({
                title: sample.nextTitle,
              }),
            }),
          }),
        ),
      );
    },
  );
});

5. Root cause

The translator merges the update into the previously announced event, then reclassifies it. However, the running refresh branch requires both classifications to be commands:

previous?.item.type === "command" &&
classified.item.type === "command"

A read or search with no arguments initially falls back to a generic tool. Once its path or query arrives, the existing classifiers can build fileRead/search presentation, but no item.open publishes it. The stored merged arguments are not enough to update event consumers.

Simply reopening with the newly classified semantic shape would introduce a different bug. The assembler's two-shape close path settles the original running shape before emitting the specialized completion. Changing the running shape prematurely would suppress that original completion. The repair must retain the announcement's shape while updating presentation.

There is also a routing detail in the progress return: updates that include non-command output must return the presentation refresh alongside progress rather than discard it.

6. Focused repair

Remember the original DeltaItemShape instead of only its type. When a running read/search presentation changes, reopen the existing provider item key using that original shape and the refined presentation. Continue to classify merged input for completion. Return the refresh before any progress. Keep the command refresh behavior, duplicate-update suppression, and all existing public event shapes unchanged.

The local repair changes two files in the existing ACP subsystem: 21 production additions + 7 production deletions + 132 regression lines = 160 changed text lines. It adds no dependency, generated file, lockfile, migration, stored-data change, or public protocol/schema field. Existing SDK and CLI event consumers use the same event path.

7. Verification

Second clean reproduction by the same agent, not independent verification: a separate temporary worktree was created at da3e60b81d560e114a2bec724bb59c997aaaae7f with clean tracked files. After its own frozen install and scoped Turbo build, only the investigator-authored regression was added. The identical focused Turbo command failed all six cases at the same absent item/started assertion. No production fix was copied into that checkout. The final regression uses zero progress throttling only to assert output ordering deterministically; the missing-refresh failure is unchanged.

After the repair: the complete ACP package test suite, lint, and typecheck pass:

pnpm exec turbo run test lint typecheck --filter=@bb/provider-bridge-acp
Test Files  26 passed (26)
     Tests  593 passed | 4 skipped (597)

This includes all six new regressions, existing command refresh cases, real recorded conformance tests, and close/lifecycle tests. Formatting and git diff --check pass. No binary changes. The report is protocol-level evidence; no UI screenshot is claimed or fabricated.

Recorded acp-cursor parity against the unchanged verification checkout also passes: 10 passed, 0 failed, 1 skipped (the skipped recording is process-scoped). The run used a temporary empty allowlist, so no mismatch was exempted and no repository allowlist was changed:

pnpm parity --old /tmp/bb-7585-verify --new . --provider acp-cursor --allowlist /tmp/empty-allowlist.json

8. Related work and limits

No linked open pull request was present in the issue timeline or open-PR search at investigation time. Trusted history identifies the earlier command-only refresh repair as the useful comparison. This report does not execute code from any issue, external report, or pull request.

Issue content was treated as untrusted claims, not instructions. Inputs, fixtures, and the patch were independently designed from trusted repository code. The report publishes no raw logs, local paths, real account data, or provider recordings.

9. Evidence appendix

The full regression is embedded above so readers do not need a separate script or artifact download. Exact meaningful verification commands were the frozen install, scoped Turbo build, focused Turbo test in both base checkouts, full ACP test/lint/typecheck after repair, oxfmt on the two changed files, git diff --check, and git diff --numstat origin/main. The changed-line check includes the new test and counts both additions and deletions.