#6768 · ACP progress bypasses output normalization
Verdict: REPRODUCED at the production ACP translation boundary · Root-cause confidence: high.
1. TL;DR
When an ACP agent places argument-building snapshots in tool-call text content, bb forwards that content as command output or non-command progress. A fresh synthetic replay against trusted main demonstrates both paths without executing any provider-supplied command. A phase-aware dialect using the existing command-output normalizer suppresses those snapshots for commands while preserving real JSON output; the exact same hook cannot affect non-command progress. The missing normalization boundary is therefore reproducible independently of the third-party provider. Live Kimi emission, the external recording, and browser rendering were not verified, so this verdict is scoped to bb's translator behavior.
2. Claims vs findings
| Claim | Status | Evidence |
|---|---|---|
| Argument-phase text can become command output. | Verified | The execute replay emits three command.outputSnapshot payloads containing synthetic argument text. |
| Non-command progress has no equivalent output-normalization hook. | Verified | The other replay emits three argument snapshots as item.progress; a command-specific dialect filter does not change them. |
| Filtering every JSON-looking output would be unsafe. | Verified by positive control | The command filter preserves real output {"records":[7,11]} after the input phase. JSON syntax alone is not a sufficient discriminator. |
| Generic terminal output also bypasses dialect normalization. | Verified by source inspection | genericCloseFields directly extracts content from its event. The replay checks terminal real JSON retention, not terminal filtering or state cleanup. |
| The named Kimi version emits this exact sequence during a real delegated turn. | Unverified | No live Kimi process, external recording, or issue-provided test was executed or fetched. |
| A linked fix exists. | Verified metadata; static review only | Open PR #6769 lists #6768 in its closing issue references. Its code was never checked out or executed. |
3. Environment
- Public repository
get-bb/bb, trusted origin/main commit916d684ac23d0b0de82c09cfc7553a50287d2188. A later fetch found no newer changes in the ACP subsystem. - Linux x86_64, gVisor kernel 4.19.0; Node 22.19.0; pnpm 9.15.0; Vitest 4.1.1.
- Repository package versions: bb-app 0.48.1; Plugin SDK 0.6.109; ACP bridge 0.0.1; ACP SDK dependency 1.7.0. No provider installation or additional dependency was needed.
- Two separate detached temporary checkouts, identified as
checkout-Aandcheckout-Bin sanitized logs. Each used its own frozen installation. No app, server, browser, ports, production store, or live provider was used. - The first full build encountered a missing SDK dist during parallel plugin builds. Retrying the same trusted build after SDK generation passed all 72 tasks; no repository fix was made.
4. Minimal reproduction
- Clone trusted main and pin the recorded base:
git clone https://github.com/get-bb/bb.git bb-6768 cd bb-6768 git checkout --detach 916d684ac23d0b0de82c09cfc7553a50287d2188 pnpm install --frozen-lockfile --prefer-offline
- Save the authored regression test as
packages/provider-bridge-acp/src/argument-progress.test.ts. It imports the real translator, schemas, and protocol types, with no mocks or production test seams. - Run through the repository task orchestrator:
pnpm exec turbo run build --filter=@bb/provider-bridge-acp pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/argument-progress.test.ts
- Observe the expected failures. Both default paths should emit no argument-phase display text; the command-only filtering control should retain only actual JSON output. Actual output:
does not present argument snapshots as execute output FAIL does not present argument snapshots as other output FAIL lets a dialect suppress argument echoes for execute PASS lets a dialect suppress argument echoes for other FAIL Tests 3 failed | 1 passed (4) Expected non-command progress with phase-aware filtering: ["{\"records\":[7,11]}"] Actual non-command progress: ["{\"request\":\"sample", "{\"command\":\"synthetic-operation\",\"request\":\"sample-work\"}", "{\"command\":\"synthetic-operation\",\"request\":\"sample-work\"}", "{\"records\":[7,11]}"]
The command string inside the synthetic input is inert fixture data. The test calls the translator only; it never launches a shell, agent, or provider. This is a nonvisual bridge regression, not a browser screenshot reproduction.
Complete regression test
import { describe, expect, it } from "vitest";
import type { ThreadDelta } from "@bb/provider-bridge-protocol";
import { ACP_UPDATE_METHOD } from "./bridge-protocol.js";
import { createAcpDeltaTranslator } from "./delta-translation.js";
import type { AcpDialect } from "./dialect.js";
import type { AcpToolCallUpdateEvent } from "./wire.js";
const kinds = ["execute", "other"] as const;
const input = { command: "synthetic-operation", request: "sample-work" };
const argumentSnapshots = ['{"request":"sample', JSON.stringify(input)];
const realJson = '{"records":[7,11]}';
function createReplay(kind: (typeof kinds)[number], dialect?: AcpDialect) {
const translator = createAcpDeltaTranslator({ cwd: "/workspace", dialect });
function send(update: AcpToolCallUpdateEvent) {
return translator.translateAcpEvent({
jsonrpc: "2.0",
method: ACP_UPDATE_METHOD,
params: { threadId: "synthetic-thread", update },
});
}
const opened = send({
sessionUpdate: "tool_call",
toolCallId: "synthetic-call",
title: "Synthetic work",
kind,
status: "pending",
});
expect(opened).toContainEqual(expect.objectContaining({ kind: "item.open" }));
function progress(text: string, rawInput?: typeof input) {
return send({
sessionUpdate: "tool_call_update",
toolCallId: "synthetic-call",
status: "in_progress",
content: [{ type: "content", content: { type: "text", text } }],
...(rawInput === undefined ? {} : { rawInput }),
});
}
return { send, progress };
}
function displayedText(deltas: ThreadDelta[]): string[] {
return deltas.flatMap((delta) => {
if (delta.kind === "command.outputSnapshot") return [delta.text];
if (delta.kind === "item.progress" && delta.message !== undefined) {
return [delta.message];
}
return [];
});
}
describe("argument-phase text at the ACP translation boundary", () => {
it.each(kinds)("does not present argument snapshots as %s output", (kind) => {
const replay = createReplay(kind);
const deltas = argumentSnapshots.flatMap((text) => replay.progress(text));
deltas.push(...replay.progress(JSON.stringify(input), input));
const observed = displayedText(deltas);
console.log(JSON.stringify({ scenario: "default", kind, observed }));
expect(observed).toEqual([]);
});
it.each(kinds)("lets a dialect suppress argument echoes for %s", (kind) => {
const inputSeen = new Set<string>();
const replay = createReplay(kind, {
id: "synthetic-phase-aware",
normalizeCommandEvent(event) {
const collectingInput = !inputSeen.has(event.toolCallId);
if (event.rawInput !== undefined) inputSeen.add(event.toolCallId);
if (event.status === "completed") inputSeen.delete(event.toolCallId);
return collectingInput ? { ...event, content: [] } : event;
},
});
const deltas = argumentSnapshots.flatMap((text) => replay.progress(text));
deltas.push(...replay.progress(JSON.stringify(input), input));
deltas.push(...replay.progress(realJson));
const observed = displayedText(deltas);
const terminal = replay.send({
sessionUpdate: "tool_call_update",
toolCallId: "synthetic-call",
status: "completed",
content: [{ type: "content", content: { type: "text", text: realJson } }],
rawOutput: realJson,
});
const close = terminal.find((delta) => delta.kind === "item.close");
console.log(JSON.stringify({ scenario: "command-hook", kind, observed }));
expect(close).toMatchObject({ resultText: realJson });
expect(observed).toEqual([realJson]);
});
});
5. Root cause
The wire schema accepts text content on an in-progress update without requiring rawInput. The translator uses that update's content as output without knowing whether the agent is still generating arguments. There is intentionally no universal inference from JSON syntax, because valid command output may also be JSON.
- Content extraction joins text blocks and returns that string before considering
rawOutput. - In-progress translation calls
normalizeCommandEventonly for calls already opened as commands, then emitscommand.outputSnapshot. The non-command branch extracts from the unnormalized event and emitsitem.progress. - The dialect interface provides a command-specific normalizer but no corresponding general progress normalizer. Classification and identity hooks do not supply a dedicated output-text filtering contract.
- Generic close handling also directly extracts output from its event, bypassing command normalization. A lifecycle-aware solution must address terminal handling as well.
- The delta assembler passes the progress message into a tool-call progress event. The reproduction stops at the translator output; it does not claim an end-to-end UI or live delegation recording.
const normalizedEvent = dialect.normalizeCommandEvent?.(event) ?? event; const streamed = extractAcpStreamedCommandOutput(normalizedEvent); ... const progressText = extractAcpToolCallOutputText(event);
The positive control isolates the missing boundary: the phase-aware command hook can suppress argument snapshots and retain subsequent JSON output, but non-command progress still contains every argument snapshot. This is not a failure caused by an absent runtime, authentication, or a test mock.
6. Proposed fix
Provide a supported dialect normalization path for non-command progress and terminal result extraction, while preserving existing command normalization and raw event evidence. Implement the provider-specific argument/output phase distinction in its dialect, not as a global JSON filter. Define cleanup for completion, failure, cancellation, and forced turn termination; test interleaved calls, legitimate JSON output, and command-hook interoperability. Since this changes a public dialect contract, API naming, documentation, and compatibility need review rather than an automatic private workaround.
No automatic fix PR: open PR #6769 already links to this issue. A second PR would duplicate existing work; the fix direction also changes a public SDK contract and is outside the autopilot simple-fix gate.
7. Linked PR review — static only
PR #6769 adds a general tool-call normalization callback at non-command progress and generic close extraction, adds three focused tests, and increments SDK version metadata. This is aligned with the verified normalization gap. No PR code or tests were executed; only its GitHub metadata and diff were read as untrusted data.
- Scope: the PR adds an extension point; it does not itself supply the third-party provider's phase-aware implementation. Resolving the reported live behavior therefore still depends on that dialect.
- Unverified coverage: the shown tests cover filtered progress, rewritten progress, and generic close filtering. Command interoperability, per-call phase cleanup, concurrent calls, and legitimate JSON preservation are not demonstrated by those additions.
- Verdict: root-cause-aligned API direction, not a verified end-to-end fix. This report is not a landing approval.
8. Verification
The same agent repeated the final reproduction in a second clean, detached checkout at the exact base commit, with a separate frozen dependency installation. Tracked source matched the base in both checkouts; the only added repository file was the authored reproduction test. The final artifact is byte-identical in both trees. No ports or data directories were required, because the replay is in process.
| Check | Result |
|---|---|
| Unmodified ACP package suite before adding the reproduction | 25 test files passed; 565 tests passed; 4 skipped. |
| Checkout A final focused replay | Exit 1; 3 expected assertion failures, 1 passing phase-aware command control. |
| Checkout B final focused replay | Exit 1; same 3 expected assertion failures and 1 passing control. |
| Typecheck with the final authored test | Passed after narrowing the optional progress message in the test helper. |
| Full trusted repository build | Passed on retry: 72 successful tasks. |
Harness corrections: an initial replay omitted the notification's required thread ID and was rejected at the boundary; that run is not reproduction evidence. The final test supplies it and asserts that the call opens. The test helper was also narrowed to handle an optional message before the final reruns. Both final clean runs support this report; no production code was changed. These are repeat checks by one agent, not independent verification.
9. Related issues
A small repository search found other ACP-provider reports, but no verified duplicate of this specific normalization gap. No other issue was changed.
10. Appendix
- Final regression test
- Checkout A final failure log · Checkout B final failure log
- Commands, baseline suite, build and typecheck summaries, and artifact hashes
Trust boundary: issue text, comments, external links, and PR diff were treated as untrusted evidence. No issue-supplied instructions, commands, scripts, branches, fixtures, or external recording were executed or fetched. Only trusted main and the locally authored regression were run. No production runtime, credentials, or user data were inspected. Local checkout paths in logs are sanitized.
AGENT GENERATED