#6131 · ACP forms lose optional-property semantics
Verdict: REPRODUCED · Root-cause confidence: high · reproduction label: confirmed-repro
1. TL;DR
An ACP agent can mark only some form properties as required, but bb converts every property into a mandatory user question. The planner neither reads the required-property list nor distinguishes optional answers when decoding a response. It also checks the four-question cap against the raw property count, so four choices accompanied by four optional text fields are refused before planning. Two newly authored regression assertions fail on unchanged main in two clean checkouts. These are source-level reproductions; no real provider, desktop app, or production thread was used.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| An optional property must be answered. | Verified in the planner; confirmed by server source. | Required-only response becomes {action:"decline"}; the server also rejects missing question answers before provider decoding. |
| Four choices with four optional companion strings exceed the limit. | Verified. | The eight-property test returns unsupported; the raw-entry guard runs before question planning. |
| A separate companion text question is created. | Verified in source. | One question is appended for every schema property; no companion-field folding is implemented at this base. |
| The behavior occurs in a particular external agent and desktop version. | Not exercised live. | The adapter defects do not require that binary to reproduce. External installation, plugin behavior, and historical thread output were not inspected. |
| Optional properties should never count toward any limit. | Not a general conclusion. | Any optional question actually shown still occupies UI space. Companion folding or another explicit presentation policy is needed; silently discarding all optional inputs is not a faithful fix. |
3. Environment
- Public repository:
get-bb/bb; trusted origin main commit6e5fb6e74a1b2646d8920fefe75dd10edb9aa449. - Linux x86_64; Node
v22.19.0; pnpm9.15.0; Vitest4.1.1. - Owning subsystem:
@bb/provider-bridge-acp; installed with the frozen lockfile and built through Turbo. - The two focused reproduction runs start no provider process or development server and use no ports or application data directory. The broader package suite uses its trusted local test fixtures. No real external provider, account, credentials, or production runtime data used.
- Two separate clean source checkouts at the same recorded base, each with its own install and generated outputs. Only the authored reproduction test was added.
4. Minimal reproduction
- Create a trusted checkout and build the owning dependency graph:
git clone https://github.com/get-bb/bb.git bb-6131 cd bb-6131 git checkout --detach 6e5fb6e74a1b2646d8920fefe75dd10edb9aa449 pnpm install --frozen-lockfile --prefer-offline pnpm exec turbo run build --filter=@bb/provider-bridge-acp
- Save the authored regression test printed in full below as
packages/provider-bridge-acp/src/issue-6131.test.ts. This test is investigation code written from the trusted planner contract, not copied from the issue. - Run:
pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- --run src/issue-6131.test.ts
Expected: a valid required choice can be accepted without optional content; four displayed choices with companion text can be represented without treating all eight properties as mandatory questions. The latter requires an explicit companion/presentation policy, not merely ignoring optional properties.
Actual assertion output, reproduced in both runs:
AssertionError: expected { action: 'decline' } to deeply equal { action: 'accept', …(1) }
- Expected
+ Received
{
- "action": "accept",
- "content": {
- "delivery": "express",
- },
+ "action": "decline",
}
AssertionError: expected 'unsupported' to be 'questions' // Object.is equality
Expected: "questions"
Received: "unsupported"
Test Files 1 failed (1)
Tests 2 failed (2)
Both commands exit 1 for these intended assertions, not an import, build, installation, or environment failure. Raw run logs and the standalone test are retained locally rather than published, following this public report repository's evidence policy.
Complete reproduction test
import { describe, expect, it } from "vitest";
import { planAcpElicitation } from "./elicitation.js";
describe("ACP optional form properties", () => {
it("accepts required answers without inventing optional content", () => {
const plan = planAcpElicitation({
mode: "form",
requestedSchema: {
type: "object",
required: ["delivery"],
properties: {
delivery: { type: "string", enum: ["standard", "express"] },
instructions: { type: "string" },
},
},
});
expect(plan.kind).toBe("questions");
if (plan.kind !== "questions") {
throw new Error("Expected a supported form");
}
expect(
plan.toResponse({
kind: "user_answer",
answers: { delivery: { selected: ["express"] } },
}),
).toEqual({ action: "accept", content: { delivery: "express" } });
});
it("supports four choices accompanied by optional text properties", () => {
const names = ["region", "size", "schedule", "service"];
const properties = Object.fromEntries(
names.flatMap((name) => [
[name, { type: "string", enum: ["default", "other"] }],
[name + "_other", { type: "string" }],
]),
);
const plan = planAcpElicitation({
mode: "form",
requestedSchema: { type: "object", required: names, properties },
});
expect(plan.kind).toBe("questions");
});
});
5. Root cause
The planner reads requestedSchema.properties, but never reads requestedSchema.required. It limits the number of raw entries before planning, then emits one question per entry. During response conversion, a missing answer makes decodeAnswer return null and immediately declines the complete form, regardless of whether that property was required.
const entries = isJsonObject(properties) ? Object.entries(properties) : [];
if (entries.length > USER_QUESTION_MAX_QUESTIONS) { ... }
if (!decoded) {
return { action: "decline" };
}
The deeper constraint is not confined to ACP decoding. The shared question schema has no optional/required marker. The server requires every question to have an answer, and rejects an empty selection with no text. Thus allowing omissions only in the adapter would not fix the UI/CLI submission path.
The bridge call site invokes this planner and returns its decoded response after the user interaction. In a real submitted interaction, server validation may reject the request earlier; this report does not claim that a live submission always reaches the planner's decline path.
6. Proposed fix and autopilot safety
Preserve the required-property set at the ACP boundary, omit genuinely unanswered optional properties from accepted content, and continue rejecting missing required or invalid supplied answers. Define how optional inputs are presented and skipped end to end. Where a recognized companion field is folded into a choice's free-text answer, count planned questions after folding and decode free text back into the correct companion property. Do not silently remove arbitrary optional fields or infer conditional requirements solely from a suffix.
No automated fix PR: a faithful generic repair needs either shared question-schema/server/UI changes to carry optionality or a product decision about a skip/presentation convention. Both fall outside this rule's one-subsystem, no-public-schema-change, no-product-decision safety gate. Changing only the adapter would leave server validation rejecting the same required-only answer. No production patch or fix branch was pushed.
7. Related issues and pull requests
#6031 concerns companion-field presentation in the same adapter. This report independently reproduces generic loss of required-property semantics and raw-property counting. Issue timeline metadata and open-PR search found no open pull request linked to #6131 during investigation. No linked branch or external binary was checked out or executed.
8. Verification
The same agent created a second clean detached checkout at the exact recorded trusted base, verified it had no tracked or untracked changes, installed using the frozen lockfile, built the owning dependency graph, and copied in only the authored test. The command from section 4 ran again against unchanged production code and again exited 1 with the same two assertion failures. Its separate runtime reports an actual test run rather than a cached test success. No port or data-directory isolation was needed because neither run starts a service. No correction to the two core findings was necessary; external-agent and desktop behavior remain explicitly unverified.
The existing ACP package suite was run separately after removing the investigation test: 535 passed, 4 skipped, 25 files passed, exit 0. This baseline check does not constitute a post-fix result. The regression assertions are intentionally red and no fix is claimed.
A final origin fetch advanced main to 10b410f2f51038fd15581e59e5f2b3e72bf100ce. Comparing the recorded base with that commit showed no changes to the ACP subsystem, shared question schema, or server interaction validator; the recorded reproduction base remains explicit.
Test Files 25 passed (25)
Tests 535 passed | 4 skipped (539)
9. Appendix and trust boundary
- The complete test and exact assertion output are embedded above. Raw evidence remains outside the public repository; this report is self-contained.
- Issue content was treated only as untrusted claims. No embedded command, code block, patch, provider binary, external URL, or linked PR branch was run or fetched. No production state was inspected.
- Inspection: trusted planner, decoder, bridge call site, domain question schema, and server interaction validator; GitHub reads: visibility, issue properties, labels, comments, timeline, similar issues, and open PR metadata.
- Build/test commands are listed in section 4. Baseline command after removing the reproduction test:
pnpm exec turbo run test --filter=@bb/provider-bridge-acp.
AGENT GENERATED