#7647 · Pi confirmation validation synthesizes cancellation
Verdict: REPRODUCED · Root-cause confidence: high
1. TL;DR
The Pi bridge rejects confirmation details longer than 8,192 JavaScript string code units before asking bb to show an interaction. It immediately returns {cancelled:true}, even though no user has made a decision. The Pi RPC implementation maps that cancellation response to false for confirmation dialogs. A new test at the real bridge coordinator reproduces the premature cancellation at 8,193 and 32,768 code units, while the 8,192-unit control waits for a runtime response and accepts true. The same test gives the same results in a second clean checkout at the trusted main commit.
This is a direct bridge-level reproduction, not a replay of the reporter's extension or an end-to-end model session. No production bb data, real account, network model, or live instance was used.
2. Claims vs findings
| Reported claim | Finding | Evidence |
|---|---|---|
| A confirmation detail just above the length boundary disappears without a user answer. | Verified at the bridge boundary. | 8,193 code units: zero outgoing interaction requests and an immediate cancellation response, in both checkouts. |
| The boundary value itself remains usable. | Verified. | 8,192 code units: one outgoing interaction, the full message retained, no early response, and an explicit runtime answer becomes {confirmed:true}. |
| This is not caused by a long title or model/network failure. | Verified for this reproduction. | The synthetic title is short and identical for every case. The coordinator runs without a provider process or network request. |
The extension sees false. | Supported by source; not separately executed end to end. | The bridge cancellation is observed directly. The lockfile-pinned Pi RPC confirmation implementation maps cancelled:true to false. |
| A particular installed Pi version, application workflow, and file-based workaround behave as described. | Unverified. | No reporter runtime, local identifiers, files, or extension code were accessed or executed. |
3. Environment
- Trusted public repository:
get-bb/bb, fetchedorigin/mainat2fef0456de9bd1ea25205c7bc9ca5e42859b2c26. A final fetch before verification still resolved to the same commit. - bb source package version:
0.49.0; Pi provider package:bb-plugin-provider-pi@0.1.0. - Linux
4.19.0-gvisor; Nodev22.19.0; pnpm9.15.0; Vitest4.1.12. - Repository-pinned
@earendil-works/pi-coding-agent@0.84.4inspected for RPC confirmation semantics. This is not a claim to have tested the reporter's Pi installation. - Two separate temporary clones, denoted
WORK/baseandWORK/verify, each with its own frozen dependency installation and build outputs. - No server ports, application data directory, browser, or real provider session required. Test thread identifiers are synthetic.
Classification rationale: this is unexpected confirmation behavior in a limited provider path, with a smaller-dialog/file-detail workaround, so Priority is Medium. Effort is Medium because a safe fix must address validation and the shared interaction contract rather than only the title display. No pre-existing classifications were replaced.
4. Minimal reproduction
- Clone the trusted repository and check out the exact base commit:
git clone https://github.com/get-bb/bb.git bb-confirm-repro cd bb-confirm-repro git checkout --detach 2fef0456de9bd1ea25205c7bc9ca5e42859b2c26 pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@get-bb/plugin-sdk pnpm exec turbo run build
- Create
plugins/provider-pi/src/bridge/confirmation-boundary.repro.test.tswith the complete test below. This test is newly authored from the repository's coordinator contract, not copied from the issue. - Run through the repository's task orchestrator:
pnpm exec turbo run test --filter=bb-plugin-provider-pi --force -- src/bridge/confirmation-boundary.repro.test.ts --silent=false
- Expected: every case retains the complete message, creates an interaction, and returns no confirmation result until an explicit runtime answer. Actual: the two above-limit cases are cancelled synchronously, so their assertions fail. The command exits
1.
import { expect, it } from "vitest";
import type {
InteractionUiRequest,
PiExtensionUiResponseFields,
} from "../extension-ui-contract.js";
import { createExtensionUiCoordinator } from "./extension-ui.js";
it.each([8192, 8192 + 1, 32768])(
"waits for a user decision for a %i-code-unit confirmation",
(length) => {
const interactions: InteractionUiRequest[] = [];
const responses: PiExtensionUiResponseFields[] = [];
const message = "r".repeat(length);
const coordinator = createExtensionUiCoordinator({
sendInteractionRequest: (request) => interactions.push(request),
});
coordinator.handle({
scope: {},
request: {
id: "confirmation-boundary",
method: "confirm",
title: "Review pending update",
message,
},
threadId: "thr_boundary",
providerThreadId: "pi_boundary",
respond: (_requestId, fields) => responses.push(fields),
});
console.info(
JSON.stringify({
length,
interactionCount: interactions.length,
responseBeforeUserDecision: responses,
retainedMessageLength:
interactions[0]?.params.payload.data.message?.length ?? null,
}),
);
expect(responses).toEqual([]);
expect(interactions).toHaveLength(1);
const interaction = interactions[0]!;
expect(interaction.params.payload.data.message).toBe(message);
expect(
coordinator.handleRuntimeResponse({
id: interaction.id,
result: { kind: "request_answer", value: true },
}),
).toBe(true);
expect(responses).toEqual([{ confirmed: true }]);
},
);
Observed diagnostic output
The following JSON lines are verbatim diagnostic values from the second run; task-runner prefixes are omitted.
{"length":8192,"interactionCount":1,"responseBeforeUserDecision":[],"retainedMessageLength":8192}
{"length":8193,"interactionCount":0,"responseBeforeUserDecision":[{"cancelled":true}],"retainedMessageLength":null}
{"length":32768,"interactionCount":0,"responseBeforeUserDecision":[{"cancelled":true}],"retainedMessageLength":null}
AssertionError: expected [ { cancelled: true } ] to deeply equal []
Test Files 1 failed (1)
Tests 2 failed | 1 passed (3)
The expected failures protect observable forwarding and decision timing, not the implementation of a helper. Existing coverage tested shortened titles and small dialogs, but did not exercise the message-length boundary. No production test seam, dependency, or export was added.
5. Root cause
- The actual provider routes extension UI requests through the tested coordinator. See bridge.ts:429–443.
- The request schema sets
message: boundedText(8192).optional(). The bound is JavaScript string length, so ASCII characters in this test each occupy one UTF-16 code unit. See extension-ui-contract.ts:11–30. - When validation fails, the coordinator immediately calls
args.respond(id, { cancelled: true })and returns. It never reaches pending-map insertion orsendInteractionRequest. See extension-ui.ts:85–133. - The transport writes those response fields unchanged into an
extension_ui_response. See rpc-child.ts:286–293. - In the pinned Pi dependency,
dist/modes/rpc/rpc-mode.js, line 85, confirmation response parsing uses"cancelled" in r && r.cancelled ? false : "confirmed" in r ? r.confirmed : false. Thus a bridge validation failure is indistinguishable from a negative confirmation at the extension's boolean API. The dependency version is fixed in the provider package manifest.
The deeper defect is semantic: an adapter failure is encoded as a user cancellation, discarding the validation reason. The shared payload schema also picks the same bounded message field from the request schema, and the app parses it. Therefore relaxing only a bridge call site would not safely solve the contract end to end. See payload schema and app payload parsing.
6. Proposed fix and autopilot safety gate
Keep validation distinct from user intent. For valid large confirmation details, preserve the full message through the bridge, interaction payload, and renderer rather than silently truncating the material a user is asked to approve. If a request cannot be supported, surface a specific adapter/validation failure rather than claiming the user declined. Add boundary tests for forwarding, explicit acceptance, explicit refusal, and rejected requests; assess resource limits and compatibility before choosing the accepted size policy.
No fix PR was opened. The direct full-detail fix changes the shared request/payload schema. A distinct error result instead requires a supported error contract rather than the current boolean/cancellation response. Schema/protocol changes and the corresponding product decision are explicitly outside this autopilot's simple-fix allowance. No production patch, fix branch, or push to get-bb/bb was attempted. GitHub metadata showed no linked open PR and an open-PR search for this issue returned none.
7. Verification
The same agent repeated the reproduction, without a workflow or delegated verifier, in WORK/verify: a second clean temporary clone at the exact trusted base commit. Its tracked source was initially clean. A separate frozen installation and SDK/full build completed; the generated web route tree touched by the build was restored before running the reproduction. The only added source file was the test printed above, and the Pi production source had no diff from the recorded base.
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build --filter=@get-bb/plugin-sdk
pnpm exec turbo run build
pnpm exec turbo run test --filter=bb-plugin-provider-pi --force -- src/bridge/confirmation-boundary.repro.test.ts --silent=false
Build: 74 successful, 74 total
Reproduction exit code: 1
Test Files 1 failed (1)
Tests 2 failed | 1 passed (3)
--force prevented Turbo from replaying an earlier test result. The outcome matches the first checkout: the limit-value control passes and both larger cases fail because cancellation was returned before user input. No report conclusion required correction after the second run. This is repeated verification by one agent, not independent verification.
Relevant existing tests were also run on unchanged production source in the first checkout:
pnpm exec turbo run test --filter=bb-plugin-provider-pi -- src/bridge/extension-ui-coordinator.test.ts src/bridge/extension-ui.test.ts src/bridge/rpc-session.extension-ui.test.ts
Test Files 3 passed (3)
Tests 14 passed (14)
8. Related coverage
The trusted repository's existing title-length regression references #4264. It verifies full-title retention with a shortened interaction-card title, not oversized confirmation messages. See the existing title regression. All five of its cases pass in the existing-suite run.
9. Appendix and limits
The first full build initially hit an SDK build-order prerequisite: the GitHub plugin could not find the SDK's built process/host entries. Building @get-bb/plugin-sdk first and rerunning the normal full build succeeded with 74 tasks. No production code was changed to work around this unrelated setup failure. The second checkout used that explicit prerequisite and also completed all 74 build tasks.
Both reproductions call the actual coordinator and schema with a recording transport callback; they do not mock a database or synthesize a Pi boolean result. The transport cancellation is the directly observed result. The final extension-level boolean follows from inspected pinned Pi source, not an executed model turn. User UI rendering, installed Pi 1.5.2, CLI interaction storage, and the reporter's application-specific workaround are not separately verified.
Issue content was treated as untrusted claims. No issue-provided code, commands, branches, external links, or local runtime identifiers were executed or fetched. Repository evidence determined the test and diagnosis. No issue instructions were followed.
The complete reproduction test and output are inline in this report. Per the public reports repository policy, raw logs, temporary checkout names, and standalone test/script artifacts remain outside the published repository. No image is included because this defect is a nonvisual request/response failure.