Skip to content

ACP agents' automatic compaction shows no compaction row (compaction_update not supported) #7751

Closed

Description

@lanjak

Summary

When an ACP agent compacts its context during a turn, bb shows no compaction row. Claude Code, Codex and Pi threads show a "Compacting context" row that changes to "Compacted context". For ACP agents, bb shows that row only for its own /compact.

ACP has a standard update for this: the compaction_update session update from the session compaction RFD. In ACP v1, an agent sends it only to a client that sets clientCapabilities.session.compaction at initialize. bb does not set this capability, and its ACP translator does not know the update.

Versions and environment

  • bb 0.49.0 (desktop), and main at 39ad460.
  • Linux (Arch), Node 26.13.1.
  • Provider: a custom ACP agent with automatic compaction. The reference adapters claude-agent-acp (0.78.0 and later) and codex-acp send this update.

Steps to reproduce

  1. Check out main at 39ad460 and install dependencies.
  2. Save this file as packages/provider-bridge-acp/src/repro-compaction.test.ts:
import { 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";

it("shows an ACP compaction_update as a compaction row", () => {
  const threadId = "t";
  const translator = createAcpDeltaTranslator();
  const assembler = createDeltaAssembler({ providerId: "acp", entropyPrefix: "e", textDeltaFlushMs: 0 });
  const run = (method: string, params: Record<string, unknown>) =>
    assembler.assemble({
      threadId,
      deltas: translator.translateAcpEvent({ jsonrpc: "2.0", method, params: { threadId, ...params } }, { threadId }),
    });
  run(ACP_TURN_STARTED_METHOD, {});
  const events = [
    ...run(ACP_UPDATE_METHOD, { update: { sessionUpdate: "compaction_update", compactionId: "cmp_1", status: "in_progress" } }),
    ...run(ACP_UPDATE_METHOD, { update: { sessionUpdate: "compaction_update", compactionId: "cmp_1", status: "completed" } }),
  ];
  expect(events.map((event) => event.type)).toEqual(["item/started", "item/completed", "thread/compacted"]);
});
  1. Run pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/repro-compaction.test.ts.

Expected vs actual

Expected: a contextCompaction item starts and completes, and the thread records thread/compacted, as for Claude Code, Codex and Pi.

Actual:

AssertionError: expected [ 'provider/unhandled', …(1) ] to deeply equal [ 'item/started', …(2) ]

- Expected
+ Received

  [
-   "item/started",
-   "item/completed",
-   "thread/compacted",
+   "provider/unhandled",
+   "provider/unhandled",
  ]

In a live thread, the agent does not send compaction_update, because bb does not set the capability. It sends its fallback instead. A custom agent that reported compaction as a think tool call showed in the timeline as "Thought" with the text {"afterTokens":84783,"beforeTokens":120388}. A user read the thread as stalled during compaction, but the compaction took less than one second.

Evidence

What you ruled out

Suggested priority and effort

Low priority, small effort. The problem occurs for each ACP agent with automatic compaction. The thread keeps all data, but the user cannot see that compaction occurred.

AGENT GENERATED

Activity

  1. added theissue type on Nov 18, 2026
  2. added
    providers
    provider-acp
    confirmed-repro
    on Nov 18, 2026
  3. bb-slop-cop commented on Nov 18, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Classification: Bug · Priority: Low · Effort: Medium. Labels: providers, provider-acp, confirmed-repro.

    Reproduction report: REPRODUCED · Root-cause confidence: high.

    ACP initialization omits session-compaction support, and automatic compaction updates fall through to provider/unhandled instead of producing compaction timeline events. A newly authored two-test reproduction fails for those reasons in two clean checkouts of 3c8f94a21d; the existing translation suite passes all 91 tests. Live adapter/UI behavior was not exercised.

    No PR: A complete repair changes the advertised ACP capability and notification contract, outside this rule’s simple-fix safety scope.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproprovider-acpproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions