Repository navigation
Conversation
ACP form fields named <field>__other were planned as a separate required question, so the free-text 'Other' answer appeared as its own question. Fold the __other text field into its choice, multi-choice, or typed-choice question as one question with free text enabled. A typed-choice answer matching a value or label becomes the value; any other text is sent as the Other field.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Thanks @VinSpee for the PR. This repo approves new contributors before it reviews their PRs, so this PR now closes on its own. That is expected. Join the #contributors channel in Discord (https://discord.gg/kvBU6tJhcJ), post a link to this PR, and explain what it changes and why. A maintainer then adds you to the allow list and can reopen the PR. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c18c75b241
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| continue; | ||
| } | ||
| if (!decoded && !typed) { |
There was a problem hiding this comment.
Reject an empty folded multi-select
When a folded multi-select resolution contains selected: [] and no free text, decodeAnswer is still truthy because every succeeds on the empty array, so this condition is skipped and toResponse accepts { tags: [] } even though neither the choice nor its __other companion was answered. Require a nonempty selection or typed text before accepting this branch.
AGENTS.md reference: AGENTS.md:L13-L13
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Implemented on the fork branch in fa118b4. The folded-answer branch now requires a nonempty valid selection or nonblank custom text. Empty selections without custom text decline. Invalid nonempty selections also decline, even when custom text is supplied; custom text alone remains valid.
Existing regression coverage: packages/provider-bridge-acp/src/elicitation.test.ts, folds an Other text field into a multi-select question, covers empty selections, whitespace-only custom input, invalid selections with custom input, and valid custom-only answers. The added assertions failed before the correction and passed afterward. Previously verified at this exact commit with pnpm exec turbo run test typecheck lint --filter=@bb/provider-bridge-acp: 25 test files passed, 540 tests passed, 4 skipped; typecheck and lint passed.
This closed PR still records head c18c75b, so the correction is not yet in its recorded diff. Leaving this thread unresolved until maintainer approval/reopening and verification that the PR head includes fa118b4.
| continue; | ||
| } | ||
| const choiceName = entry.name.slice(0, -OTHER_FIELD_SUFFIX.length); | ||
| const choice = fields.find((candidate) => candidate.name === choiceName); |
There was a problem hiding this comment.
Bound fields before linear companion lookup
When a malformed or custom ACP agent sends many __other properties, every companion performs a linear scan of all fields before the question-count check, making form planning quadratic and synchronously blocking the bridge for a request that must be declined. Each visible question can absorb at most one companion, so reject source counts above twice USER_QUESTION_MAX_QUESTIONS before this pass, or index fields once.
AGENTS.md reference: AGENTS.md:L13-L13
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Implemented on the fork branch in fa118b4. Requests with more than 2 * USER_QUESTION_MAX_QUESTIONS source fields are now refused before field planning and planQuestionFields companion scans. Each visible question can absorb at most one companion, so this preserves every form that can fit while bounding the scan.
Existing regression coverage: packages/provider-bridge-acp/src/elicitation.test.ts, counts each choice with its Other text field as one question toward the limit, checks four folded question pairs (eight source fields). Previously verified at this exact commit with the package test/typecheck/lint command: 540 passed, 4 skipped. A direct runtime smoke check also refused a 20,000-field form as unsupported in about 4 ms locally, while accepting four folded questions.
This closed PR still records head c18c75b, so the correction is not yet in its recorded diff. Leaving this thread unresolved until maintainer approval/reopening and verification that the PR head includes fa118b4.
Human comments
What was wrong
ACP form fields from omp arrive as a choice field
<name>plus a free-text companion<name>__other.planAcpElicitationplanned one bb question per form field, so the free-text companion became a separate question that had to be answered. Root cause:packages/provider-bridge-acp/src/elicitation.tsnever folded<name>__otherinto its choice question. Fixes #6031.What changed
packages/provider-bridge-acp/src/elicitation.ts<name>__othertext field folds into<name>when<name>is achoice,multiChoice, ortypedChoicefield. The pair becomes one question withallowFreeTextset.choiceandmultiChoice: valid selections and typed text are returned under their original field names. Empty answers and invalid nonempty selections decline. Custom text alone is accepted.typedChoice: a typed value that matches an option is returned as<name>. Any other typed text is returned as<name>__other. Empty declines.__otherfields are unchanged.packages/provider-bridge-acp/src/elicitation.test.ts: five added tests cover folded pairs, the four-question boundary, text-only fields, and empty or invalid folded answers.HOST_DAEMON_PROTOCOL_VERSIONchange. No changelog entry: this repository writes entries during release.How you verified
b143a22(see ACP question forms split an 'Other' free-text field into a separate required question #6031): one choice plus its__otherproduced two questions. With this change it produces one.b143a22's converter; the text-only boundary passes on both. Added empty/invalid-answer assertions failed in two test cases before the review correction.pnpm exec turbo run test typecheck lint --filter=@bb/provider-bridge-acp: pass. Tests: 25 files, 540 passed, 4 skipped.elicitation.test.ts: 10 tests.pnpm exec oxfmt --check packages/provider-bridge-acp/src/elicitation.ts packages/provider-bridge-acp/src/elicitation.test.ts: pass.acp-ompUI check against the isolatedpnpm desktop:worktreeinstance: one question with Red, Blue, and inline Other. Red submitted without a text answer; OMP receivedFirst answer: Red. Other opened a text field inside the same question; Green submitted and OMP receivedSecond answer: Green. The test thread finished idle. Screenshots were captured through a browser connected to the same packaged server; native window launch was confirmed separately with Cua Driver.fa118b4, a live multi-select UI check submitted Red plus custom input Green in the same question. OMP receivedUser selected: RedandUser provided custom input: Green. The thread returned to idle.Fixes #6031