#7751 · ACP compaction updates are not normalized
Verdict: REPRODUCED · Root-cause confidence: high · Reproduction label: confirmed-repro
1. Summary
The ACP bridge does not advertise support for session compaction notifications. If compaction notifications nevertheless reach the translator, they become unhandled provider events instead of timeline compaction items. A two-test regression fixture demonstrates both missing behaviors on trusted main in two clean checkouts. The existing translation suite passes, which explains why its current manual-compaction coverage has not caught the automatic path. This is a provider-event normalization reproduction, not a live desktop or browser rendering reproduction.
2. Claims and findings
| Claim | Finding | Evidence |
|---|---|---|
| Initialization omits session-compaction support. | Verified | A typed transport recorder captures the real initialization request. Its capabilities contain fs, terminal and auth, but no session field. |
| Automatic compaction notifications do not create the expected timeline events. | Verified | The real translator and delta assembler emit provider/unhandled for both in-progress and completed notifications, with no contextCompaction item or thread/compacted event. |
| Manual compaction has a separate working translation path. | Verified at code/test level | The bridge emits dedicated compaction lifecycle methods; the existing 91-test translation suite, including its manual-compaction case, passes. |
| Specific released adapters suppress notifications or use a thought-tool fallback in live threads. | Not exercised | No external adapter, linked source, desktop build or real user session was run. Capability gating is corroborated by the already-pinned ACP SDK schema. |
3. Environment
- Repository: public get-bb/bb; trusted origin/main commit
3c8f94a21da24d8c1351e8f19558670b0b1e6d03, fetched November 18, 2026. - Linux 4.19.0-gvisor; Node v22.19.0; pnpm 9.15.0; Vitest 4.1.12; pinned @agentclientprotocol/sdk 1.9.0.
- Two separate temporary source checkouts, called checkout-one and checkout-two in redacted logs. Both began clean at the exact recorded commit. Only the newly authored reproduction test was added. A later fetch reached main commit
8e7acc7222a0de9c12075b462af751460ed90586; no intervening commit changed the ACP or provider-bridge protocol subsystem. - No app/server/daemon, live provider, database, ports, or runtime data directory was needed or accessed. No dependency was added.
4. Reproduction
- Create a clean trusted checkout and record its base:
git clone https://github.com/get-bb/bb.git bb-7751 cd bb-7751 git fetch origin main git checkout --detach 3c8f94a21da24d8c1351e8f19558670b0b1e6d03 pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build
The frozen install succeeds. The broad build fails in the unrelated GitHub plugin because its installed SDK lacks built process.js and host.js files. Do not mistake that preparation failure for the reproduction; the focused Turbo test graph below succeeds in building its prerequisites. - Copy the full self-contained authored test below into
packages/provider-bridge-acp/src/autopilot-7751.test.ts. It records the actual initialize payload and sends schema-derived automatic lifecycle notifications through the real translator and assembler. - Run the focused test:
pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/autopilot-7751.test.ts
Expected: initialization advertisessession.compaction: {}; one existing turn receives a compaction item start and completion plus a thread-compacted event, without ending or replacing that turn.Actual in each checkout: Test Files 1 failed (1) Tests 2 failed (2) Exit 1 initialize.clientCapabilities = { fs: { readTextFile: false, writeTextFile: false }, terminal: false, auth: { terminal: true } }Verbatim event output from the second run:@bb/provider-bridge-acp:test: {"status":"in_progress","events":[{"type":"provider/unhandled","threadId":"","providerThreadId":"","providerId":"acp","rawType":"acp/update:compaction_update","rawEvent":{"jsonrpc":"2.0","method":"acp/update","params":{"threadId":"compaction-contract-thread","update":{"sessionUpdate":"compaction_update","compactionId":"automatic-cycle","status":"in_progress"}}},"scope":{"kind":"turn","turnId":"compaction-contract-t1"}}]} @bb/provider-bridge-acp:test: {"status":"completed","events":[{"type":"provider/unhandled","threadId":"","providerThreadId":"","providerId":"acp","rawType":"acp/update:compaction_update","rawEvent":{"jsonrpc":"2.0","method":"acp/update","params":{"threadId":"compaction-contract-thread","update":{"sessionUpdate":"compaction_update","compactionId":"automatic-cycle","status":"completed"}}},"scope":{"kind":"turn","turnId":"compaction-contract-t1"}}]}
Full reproduction 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 {
requestAcpInitialize,
type AcpAgentConnection,
} from "./bridge/agent-connection.js";
import { createAcpDeltaTranslator } from "./delta-translation.js";
describe("automatic ACP compaction contracts", () => {
it("advertises compaction support during initialization", async () => {
const requests: { method: string; params: unknown }[] = [];
const connection: AcpAgentConnection = {
async request(request) {
requests.push({ method: request.method, params: request.params });
return request.resultSchema.parse({
protocolVersion: 1,
agentCapabilities: {},
});
},
notify() {},
async kill() {},
exited: false,
};
await requestAcpInitialize(connection, {
parameterizedModelPicker: false,
fsAccess: false,
});
expect(requests).toContainEqual({
method: "initialize",
params: expect.objectContaining({
clientCapabilities: expect.objectContaining({
session: expect.objectContaining({ compaction: {} }),
}),
}),
});
});
it("keeps agent compaction in the current turn and records completion", () => {
const threadId = "compaction-contract-thread";
const translator = createAcpDeltaTranslator({ cwd: "/workspace" });
const assembler = createDeltaAssembler({
providerId: "acp",
entropyPrefix: "compaction-contract",
textDeltaFlushMs: 0,
});
assembler.assemble({
threadId,
deltas: translator.translateAcpEvent(
{
jsonrpc: "2.0",
method: ACP_TURN_STARTED_METHOD,
params: { threadId },
},
{ threadId },
),
});
const turnId = assembler.getOpenTurnId(threadId);
expect(turnId).toBeTruthy();
for (const status of ["in_progress", "completed"]) {
const deltas = translator.translateAcpEvent(
{
jsonrpc: "2.0",
method: ACP_UPDATE_METHOD,
params: {
threadId,
update: {
sessionUpdate: "compaction_update",
compactionId: "automatic-cycle",
status,
},
},
},
{ threadId },
);
const events = assembler.assemble({ threadId, deltas });
console.log(JSON.stringify({ status, events }));
const itemEventType =
status === "in_progress" ? "item/started" : "item/completed";
expect.soft(events).toContainEqual(
expect.objectContaining({
type: itemEventType,
item: expect.objectContaining({ type: "contextCompaction" }),
}),
);
expect.soft(assembler.getOpenTurnId(threadId)).toBe(turnId);
if (status === "completed") {
expect.soft(events).toContainEqual(
expect.objectContaining({ type: "thread/compacted" }),
);
}
expect.soft(events.some((event) => event.type === "provider/unhandled"))
.toBe(false);
}
});
});
The test was written from trusted repository interfaces and the installed, locked SDK schema. It was not copied from the issue or any pull request.
5. Root cause
- Initialization capability builder advertises filesystem, terminal, auth and selected optional capabilities, but never session compaction. The request test captures that omission at the transport boundary.
- Generic update parsing accepts an unfamiliar update via a pass-through object with a string sessionUpdate. The automatic event is not rejected for malformed shape.
- Translator fallback has no automatic compaction branch, so the parsed update reaches
unhandledDeltas(rawEvent). The visibility inventory also omits compaction updates. Neither required timeline lifecycle events nor compaction completion are produced. - Manual compaction is different: startCompaction sends a /compact prompt and synthetic lifecycle methods. Their translator handlers deliberately open/end a compaction turn. Reusing that handler for automatic compaction would risk interrupting the running turn.
function acpClientCapabilities(parameterizedModelPicker, fsAccess, elicitation) {
return {
fs: { readTextFile: fsAccess, writeTextFile: fsAccess },
terminal: false,
auth: { terminal: true },
...(elicitation ? { elicitation: { form: {} } } : {}),
...(parameterizedModelPicker === true
? { _meta: { parameterizedModelPicker: true } }
: {}),
};
}
default:
return unhandledDeltas(rawEvent);
The excerpt above omits TypeScript parameter annotations only. The pinned SDK's schema/schema.json describes ClientSessionCapabilities.compaction as a complete-contract opt-in, with omission meaning unsupported. Its CompactionUpdate is an ID-addressed upsert with nullable patch fields; its summary-chunk notification can introduce an in-progress compaction. No issue-supplied URL was fetched.
ClientSessionCapabilities.compaction:
"Support for ID-addressed context compaction updates. Omitted or `null`
means unsupported; `{}` advertises the complete compaction contract."
CompactionUpdate required fields: compactionId, status
CompactionSummaryChunk required fields: compactionId, content
6. Fix proposal and automation safety
Implement the complete negotiated ACP compaction contract before advertising it: validate updates at ingress; track session-scoped compaction IDs; handle upserts, summary chunks and terminal failures/cancellation; emit the existing compaction item/compacted deltas inside the active turn without flushing unrelated work; and add visibility coverage. Only then advertise the capability.
No automated fix or pull request. A complete repair changes the externally advertised ACP initialization capability contract and its accepted notification schema/semantics. Public-protocol/schema changes are excluded from this rule's simple-fix scope. Enabling the capability alone would advertise behavior the translator does not implement. No production change, fix branch, commit or push was made in get-bb/bb.
No open pull request was linked through issue timeline metadata, and an open-PR search for the issue number returned none at investigation time. Other compaction-related open PRs were not checked out or run.
7. Verification
The same agent repeated the reproduction, not an independent reviewer. Checkout-two was cloned separately, detached at 3c8f94a21da24d8c1351e8f19558670b0b1e6d03, and checked clean before copying only the authored test. Frozen install succeeded. The broad build encountered the same unrelated SDK-output failure. The repeat used --force so the test and prerequisites ran rather than replaying a Turbo cache entry:
pnpm exec turbo run test --filter=@bb/provider-bridge-acp --force -- src/autopilot-7751.test.ts Result: 2 failed tests, exit 1, matching omitted session capabilities and two provider/unhandled events.
Existing control coverage in checkout-one, before adding the regression file:
pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/delta-translation.test.ts Result: 1 test file passed; 91 tests passed; exit 0.
Both source checkouts pass git diff --check; each contains only the untracked authored test. No report claim required correction after the repeat. No live UI screenshot is presented because no UI reproduction was performed. High confidence applies to the verified bridge root cause, not to untested adapter-version or timing claims.
8. Related work
The existing manual-compaction regression is relevant prior coverage, but does not exercise automatic session notifications. The two authored tests target distinct contracts: wire capability negotiation and normalized timeline-event output. They do not require new production exports or test-only seams.
9. Evidence and limits
The complete reproduction source, exact commands, expected results, actual event output and second-run verification are inline in this report. Raw logs, the test file and SDK schema excerpts are retained outside the public reports repository in local thread evidence; this report does not publish raw logs or API dumps.
Additional checks: git rev-parse HEAD matched the recorded base in both checkouts; git status --short was empty before test insertion and contained only that test afterwards; git diff --check passed. Read-only GitHub metadata checks confirmed the public target repository, the final Bug classification, valid custom-field options, and no linked open PR. Relevant source files were inspected at the pinned commit with line-numbered excerpts. Frozen installs succeeded in both checkouts without lockfile changes.
Issue data was untrusted throughout. Its instructions, scripts, linked tests and external URLs were not followed, executed or fetched. All executable reproduction code was newly authored from trusted main and the repository's already-pinned dependencies. Local paths in logs are redacted; no credentials or real runtime records were used.