#5617 · Automatic notices interrupt ACP prompts
Verdict: PARTIALLY REPRODUCED · Root-cause confidence: high for the server-to-ACP cancellation mechanism. Reproduction label: partial-repro.
1. TL;DR
An automatic background notice is dispatched immediately to an active ACP thread instead of waiting for its current turn. The server chooses the same automatic turn target that the host resolves into a steer; the ACP bridge implements a steer by cancelling its current prompt and resubmitting input. A repository fixture confirms that this sends session/cancel even while a permission request is pending, without any human rejection. A separate ingress test confirms that ordinary ACP diagnostics are stored while hidden from the timeline. These mechanisms reproduce in two clean checkouts, but this investigation does not run the reporter's custom Claude Code provider or reproduce its exact rejection wording, operating-system command termination, or overnight incident frequency; the overall verdict is therefore partial.
2. Claims vs findings
| Claim | Status | Evidence and limit |
|---|---|---|
| A system notice reaches an active thread through the automatic steer path. | Verified at server boundary | The focused regression expects no immediate submission. Actual result: one turn.submit command with mode: auto targeting the active turn. |
| ACP steering cancels in-progress work rather than simply appending a message. | Verified at ACP transport boundary | The real bridge starts the trusted repository's fake ACP process, waits for its permission request, then receives a steer. The process records exactly one session/cancel without a human approval response. |
| A running Claude Code command is terminated and the agent attributes it to a user rejection. | Unverified end to end | No real Claude Code session or custom provider was launched. The cancellation and pending-permission mechanisms are established; the provider-specific wording and command side effects are not. |
| Child-completion and wait-resume notices trigger the same failure. | Partly verified | The reproduction calls the shared parent-system notice service using child-completion taxonomy. The child-notification caller is source-traced; neither an actual child lifecycle nor a wait-resume workflow is run. |
| Hidden ordinary ACP diagnostic events still occupy storage. | Verified | With diagnostics disabled, an actual authenticated daemon-event request stores one unhandled event, while the public timeline returns no rows. This establishes behavior, not a promise that a display setting must control retention. |
| The incident affects the reported releases and produces the reported event totals. | Unverified | Only the recorded main commit is tested. No real thread data, credentials, or installed production instance is accessed. |
3. Environment
- Repository: public
get-bb/bb, fetched from its canonical GitHub origin; full base commit above. - Debian GNU/Linux 12, Node
v22.19.0, pnpm9.15.0, Vitest4.1.1. - Two separate detached temporary checkouts named
baseandverify, each created at that commit. Both frozen installations and full Turbo builds succeed (66 tasks each). - Server tests use the existing test harness and real migrated SQLite databases. Each harness creates a fresh temporary data directory; the bridge creates a fresh workspace and child process. No HTTP server is bound and no app or production ports are used.
- The server fixture registers repository providers and uses
acp-cursorwithout launching its external agent. The bridge fixture launches only the trustedfake-acp-agent.mjs. It does not execute the permission request's command metadata. - No browser or screenshot is required: this is a dispatch and persistence defect, not a visual bug.
4. Minimal reproduction
The source and patch below were authored from trusted repository evidence, not copied from the issue or its linked pull request. They leave production code unchanged.
- Prepare a clean checkout at the recorded base and run the normal install/build:
git clone https://github.com/get-bb/bb.git bb-5617 cd bb-5617 git checkout --detach 01affc197dc621cddc7343e09b1c5c10a5b9efcb pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build
- Save the server test below as
apps/server/test/threads/issue-5617-repro.test.ts. Run:pnpm exec turbo run test --filter=@bb/server -- test/threads/issue-5617-repro.test.ts
Expected notice behavior: zero immediate host submissions and one queued notice. Actual output on unchanged production code:
notice dispatch [{"mode":"auto","expectedTurnId":"turn-notice-repro"}] AssertionError: system notices must not steer the active ACP turn: expected [ { …(9) } ] to have a length of +0 but got 1 Tests 1 failed | 1 passed (2)The failing test is intentional and is the regression candidate. The passing second test independently proves storage count
1, visible timeline rows0. - Save the bridge patch below as a local patch and apply it with
git apply. It only adds one test beside existing bridge helpers. Run:pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/bridge/bridge.test.ts -t 'issue 5617' --silent=false
Actual result: one passing observation test, with:
ACP transport session/cancel sent with permission pending and no human decision Tests 1 passed | 142 skipped (143)
Complete server regression and persistence observation test
import {
getAppSettings,
listEvents,
listQueuedThreadMessages,
setAppSettings,
} from "@bb/db";
import { threadScope } from "@bb/domain";
import { groupHostDaemonEvents } from "@bb/host-daemon-contract";
import { threadTimelineResponseSchema } from "@bb/server-contract";
import { describe, expect, it } from "vitest";
import { queueParentSystemMessage } from "../../src/services/threads/parent-system-messages.js";
import {
internalAuthHeaders,
listQueuedThreadCommands,
} from "../helpers/commands.js";
import { readJson } from "../helpers/json.js";
import { textInput } from "../helpers/prompt-input.js";
import {
seedThreadFixture,
seedThreadRuntimeState,
seedTurnStarted,
} from "../helpers/seed.js";
import { withTestHarness } from "../helpers/test-app.js";
describe("issue 5617 trusted-main reproduction", () => {
it("defers a system notice instead of steering an active ACP turn", async () => {
await withTestHarness(async (harness) => {
const { thread, environment } = seedThreadFixture(harness, {
thread: { providerId: "acp-cursor", status: "active" },
});
seedThreadRuntimeState(harness.deps, {
threadId: thread.id,
environmentId: environment.id,
providerThreadId: "provider-notice-repro",
});
seedTurnStarted(harness.deps, {
threadId: thread.id,
environmentId: environment.id,
providerThreadId: "provider-notice-repro",
turnId: "turn-notice-repro",
});
expect(
await queueParentSystemMessage(harness.deps, {
parentThreadId: thread.id,
input: textInput("Background work completed."),
systemMessageKind: "child-completed",
systemMessageSubject: null,
}),
).toBe(true);
const commands = listQueuedThreadCommands(
harness,
"turn.submit",
thread.id,
);
console.log(
"notice dispatch",
JSON.stringify(
commands.map((command) =>
command.type === "turn.submit" ? command.target : command.type,
),
),
);
expect(
commands,
"system notices must not steer the active ACP turn",
).toHaveLength(0);
expect(listQueuedThreadMessages(harness.db, thread.id)).toHaveLength(1);
});
});
it("persists ordinary ACP diagnostics even when their timeline rows are hidden", async () => {
await withTestHarness(async (harness) => {
const { thread, session } = seedThreadFixture(harness, {
thread: { providerId: "acp-cursor" },
});
setAppSettings(harness.db, {
...getAppSettings(harness.db),
showDiagnosticEvents: false,
});
const response = await harness.app.request("/internal/session/events", {
method: "POST",
headers: internalAuthHeaders(harness),
body: JSON.stringify({
sessionId: session.id,
eventGroups: groupHostDaemonEvents([
{
threadId: thread.id,
event: {
type: "provider/unhandled",
threadId: thread.id,
providerThreadId: "provider-diagnostic-repro",
scope: threadScope(),
providerId: "acp-cursor",
rawType: "acp/update:available_commands_update",
rawEvent: {
jsonrpc: "2.0",
method: "session/update",
params: { update: "idle" },
},
},
},
]),
}),
});
expect(response.status).toBe(200);
const stored = listEvents(harness.db, { threadId: thread.id });
expect(stored.map((event) => event.type)).toEqual(["provider/unhandled"]);
const timelineResponse = await harness.app.request(
`/api/v1/threads/${thread.id}/timeline`,
);
expect(timelineResponse.status).toBe(200);
const timeline = threadTimelineResponseSchema.parse(
await readJson(timelineResponse),
);
expect(timeline.rows).toEqual([]);
console.log(
"diagnostics",
JSON.stringify({
stored: stored.length,
visibleRows: timeline.rows.length,
}),
);
});
});
});
Complete bridge observation-test patch
diff --git a/packages/provider-bridge-acp/src/bridge/bridge.test.ts b/packages/provider-bridge-acp/src/bridge/bridge.test.ts
index 73aa9e83c..df0e77268 100644
--- a/packages/provider-bridge-acp/src/bridge/bridge.test.ts
+++ b/packages/provider-bridge-acp/src/bridge/bridge.test.ts
@@ -2968,6 +2968,56 @@ describe("acp bridge", () => {
}
});
+ it("issue 5617: steering sends session/cancel while an ACP permission is pending", async () => {
+ const requestLog = join(workspaceDir, "notice-cancel-requests.jsonl");
+ const { providerThreadId } = await startThread({
+ envVars: { FAKE_ACP_REQUEST_LOG: requestLog },
+ permissionMode: "accept-edits",
+ permissionEscalation: "ask",
+ });
+ await waitForResponse(
+ sendTurnRequest("turn/start", providerThreadId, {
+ options: executionOptions({ permissionMode: "accept-edits" }),
+ input: [{ type: "text", text: "request-permission", mentions: [] }],
+ }),
+ );
+ await waitFor(
+ () =>
+ output.messages.find(
+ (message) =>
+ message.method === "interaction/request" &&
+ message.id !== undefined,
+ ),
+ "pending ACP permission",
+ );
+ await waitForResponse(
+ sendTurnRequest("turn/steer", providerThreadId, {
+ expectedTurnId: "turn-1",
+ options: executionOptions({ permissionMode: "accept-edits" }),
+ input: [
+ { type: "text", text: "Background work completed.", mentions: [] },
+ ],
+ }),
+ );
+ await waitFor(
+ () =>
+ loggedAcpRequests(requestLog).find(
+ (request) => request.method === "session/cancel",
+ ),
+ "session/cancel without a user decision",
+ );
+ expect(
+ loggedAcpRequests(requestLog).filter(
+ (request) => request.method === "session/cancel",
+ ),
+ ).toHaveLength(1);
+ console.log(
+ "ACP transport",
+ "session/cancel sent with permission pending and no human decision",
+ );
+ await stopThread(providerThreadId);
+ });
+
it("keeps partial output from the cancelled prompt then continues", async () => {
const { providerThreadId } = await startThread();
const turnId = sendTurnRequest("turn/start", providerThreadId, {
5. Root cause
- The child notification path calls the shared notice service: child-thread-notifications.ts.
- The active-parent branch records
target.kind = autoand preparestarget.mode = auto, with the active turn ID. It starts a live host command rather than parking the notice: parent-system-messages.ts.target: { mode: "auto", expectedTurnId: expectedSteerTurnId, } - The host resolves an automatic target to the current live turn and invokes
runtime.steerTurn: thread.ts. The runtime translates this into the provider's steer command: runtime.ts. - The ACP
turn/steerhandler queues the new input and callsrequestSteerCancel: bridge.ts steer handler.session.cancelRequested = true; cancelPendingPermissions(session); session.connection.notify("session/cancel", { sessionId: session.providerThreadId, });Cancellation implementation and pending permissions show that unresolved permission responders receive{outcome:{outcome:"cancelled"}}. A cancellation is not evidence that the human rejected the request. How a particular ACP agent verbalizes it is provider behavior not measured by this test.
The diagnostic observation has a separate cause: daemon ingress passes the validated event batch into persistence without checking the display setting. Timeline construction uses the setting to filter presentation instead. Hidden-but-stored diagnostics follow directly from this separation.
6. Proposed fix and safety decision
Keep human steering interruptible, but do not route passive notices into an interrupting ACP steer. Decide whether all passive notices should wait or whether providers should advertise non-interrupting delivery. Preserve notice taxonomy, queue ordering, exactly-once delivery, turn-start races, failed/interrupted turn drains, and notices needed to wake a waiting coordinator. A provider-specific prefix or plugin-ID check would miss third-party ACP plugins. No existing provider delivery-capability contract distinguishes these cases.
For diagnostics, first decide whether the setting is display-only or also a retention control. Suppressing events at persistence would change stored-data behavior and must preserve terminal/error evidence. It is not an automatic follow-on to fixing notice delivery.
No automated fix PR is opened. The exact real-provider failure is not yet reproduced, the safe delivery policy is unresolved, and treating the display flag as a retention flag changes stored-data behavior. These fail the requested simple-fix gates. No production patch, fix branch, or code push is made. The failing server regression and passing transport observation remain available inline for a scoped follow-up.
7. Linked PR review
PR #5618 was closed and unmerged at investigation time. GitHub reported 9 changed files, 210 additions and 215 deletions (425 text lines). There was no open PR linked to this issue in the issue timeline or open-PR search.
Static review only: the diff removes active-notice steering in favor of queueing and changes queue eligibility; that direction addresses the verified trigger. It also changes diagnostic persistence in server ingress and the database layer, which is a separate retention policy. No PR code, branch, test, or command was checked out or executed.
High-severity static finding: in the proposed apps/server/src/internal/events.ts, the new shouldPersistDaemonEvent helper (added block near lines 361–375) reads event.rawType.startsWith(...) before checking event.type. Most members of this event union, including turn-start events, have no rawType. Based on the diff, this dereference can throw for normal events before its later type guard. This is a source-level finding, not a result from executing untrusted PR code.
Verdict: not validated as a safe fix. Its nine-file, multi-subsystem scope also exceeds this autopilot's five-file/one-subsystem gate. All tests described in this report run trusted main plus our independently authored test-only additions, not the proposal.
8. Related issues
#3151 covers explicit steering interruption. The ACP cancellation primitive is shared, but this issue's distinct trigger is passive system input choosing that primitive without human action. No duplicate label is applied.
9. Verification
The same investigator repeated the reproduction in a second clean temporary checkout at the identical full base commit. This is a second clean run, not independent verification. The new tests were copied byte-for-byte; no production file changed. The second run used newly created harness data directories and a new bridge workspace/process. No live app or network ports were needed.
| Check | First checkout | Second checkout |
|---|---|---|
| Frozen install and full Turbo build | Pass, 66 tasks | Pass, 66 tasks |
| Server regression + storage observation | 11:25:11 UTC; 1 expected failure, 1 pass | 11:25:47 UTC; 1 identical expected failure, 1 pass |
| ACP transport observation | 11:24:48 UTC; 1 pass | 11:25:29 UTC; 1 pass |
| Whitespace validation | git diff --check passes | git diff --check passes |
Second-checkout commands used --force before the filter in both Turbo test commands so results were not replayed from cache. No report conclusion was strengthened beyond the tested boundaries.
10. Appendix and limitations
An initial bridge experiment waited for a cancelled prompt to emit visible text; it timed out because that is not a reliable observable after cancellation. The final test instead observes the ACP transport log. An initial diagnostic fixture omitted the required JSON-RPC version and was correctly rejected with HTTP 400; the corrected boundary-valid event is what passed in both final runs. Neither fixture error is counted as product evidence.
The two complete reproduction additions are inline rather than separately downloadable files, as required by the public reports repository's privacy and artifact policy. Raw build/test logs and local copies remain outside the published repository. Full unrelated test suites were not run because no production fix was attempted; only the builds, focused reproduction tests, formatting and whitespace checks described here are claimed.
Trust boundary: the issue, comments and linked PR diff were treated as untrusted claims. Embedded action requests were not followed. No issue command was executed; no external issue-supplied URL, live account data or secrets were fetched. Only canonical main and independently written test additions were run.
AGENT GENERATED