Skip to content

fix(acp): form choices with matching titles get distinct labels - #48427

Open
StiensWout wants to merge 7 commits into
pingdotgg:mainfrom
StiensWout:wf/find-b3c225c93ceaa155dabb830f
Open

StiensWout wants to merge 7 commits into
pingdotgg:mainfrom
StiensWout:wf/find-b3c225c93ceaa155dabb830f

Conversation

@StiensWout

Copy link
Copy Markdown
Contributor

In an ACP form, choices whose titles matched showed the same label. For example, an empty value and a value of two quote characters both appeared as "", so the user could not tell which one they were picking. Now only the colliding titled choices (oneOf/anyOf) are labeled with their quoted values, and choices with unique titles keep them. Every value is quoted only if that would still leave two labels alike.

Related: #48389, #35996, #45050, #45792, #48334

Reproduction on main

Commit 679441f6b0 (main). Both choices are labeled "", with no description that tells them apart. Expected: The labels distinguish the empty value from the value containing two quote characters.

  1. Open a thread with the Replay (dev) value-selection demo.
  2. Send “Ask which value to save.”
  3. Read the two choices in the form.

The cause is at packages/provider-acp/src/server/elicitationForm.ts:84. Ran pnpm scenarios:prove scripts/scenarios/acp-titled-empty-choice-label.e2e.ts --target web with the repro scenario added: it failed in 2 of 2 runs on a clean boat.dev VM, with expected "\"\"" not to be "\"\"" in the output.

Evidence

Environment: The web app in Chromium on Linux x64, a fresh checkout on a boat.dev VM reset before each run.

Proven: the repro fails at the test commit aad8c1b55d and passes on the head 2a8032c024, both on main 9ba2879064.

Before After
Commit aad8c1b55d 2a8032c024
Result ASSERTION_FAILED: expected """" not to be """" passed
choice labels Before: choice labels Before: choice labels (changed region)
Both choices are labeled "", with no description that tells them apart.
After: choice labels After: choice labels (changed region)
The labels distinguish the empty value from the value containing two quote characters.
failure Before: failure
Recording Before: recording After: recording

Tests

  • aad8c1b55d adds the failing test, alone, before the fix.
  • pnpm exec vp run check:changed 9ba28790648466118cb9039516172d8586232f15 passed on head.

Not in this change

  • Enum choices keep their existing rule, which quotes every value when labels collide.
  • The Codex MCP elicitation mapper (apps/server/src/provider/CodexMcpElicitation.ts) maps approval decisions rather than form choices, so it was left as is.
  • The scenario still starts its thread as soon as the Replay settings update returns. Waiting until the live provider lists the staged recording would make it more reliable, but that edit is larger than the regression scenario allows.

Who did the work

  • Repro written by GPT 6.2 Sol, in Codex
  • Duplicate check judged by Claude Opus 5.5, in Claude Code
  • Written by Claude Opus 5.5, in Claude Code
  • Reviewed by Claude Opus 5.5, in Claude Code, and by GPT 6.2 Sol, in Codex
  • Reproduction, checks and proof run by a program on base and head, not by an agent

Made in T3 Code by Claude Opus 5.5 and GPT 6.2 Sol

StiensWout and others added 7 commits December 3, 2026 21:15
…f quotes

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Titled choices whose labels collide, such as an empty value and a pair of
quotes, now fall back to quoted values like enum choices already do.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Only the colliding titled choices show their quoted values; every value is
quoted only if that still leaves two labels alike.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…el scenario

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Dec 3, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 2a8032c

Macroscope's review found this PR approvable — ACP form choices with matching titles now receive distinct quoted-value labels. Submitted values and validation remain unchanged, limiting the impact to choice presentation.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

coderabbitai Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

ACP elicitation form conversion now disambiguates duplicate choice labels by quoting choice values, with a fallback that quotes all values if collisions remain. Unit tests cover labels, descriptions, and submitted values. A browser scenario checks that empty-string and quote-only choices render with distinct labels.

Changes: ACP choice labels

Layer / File(s) Summary
Disambiguate and verify choice labels
packages/provider-acp/src/server/elicitationForm.ts, packages/provider-acp/src/server/elicitationForm.test.ts, scripts/scenarios/acp-titled-empty-choice-label.e2e.ts
choiceOptions now resolves duplicate labels by quoting values, and quotes all values if collisions remain. Unit tests cover label and description preservation and unchanged submitted values. A browser scenario checks that the two choice labels differ. It restores the original Replay provider configuration in finally.

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Suggested reviewers: saphid

Merge Risk: Minimal · up to 2a803

The change makes ACP form choices with colliding titles show distinct labels, and unique titles are unchanged. It adds unit and browser coverage and carries no known merge-blocking risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "fix(acp): form choices with matching titles get distinct labels" matches the main change. The raw summary and objectives describe disambiguating colliding titled choices in ACP elicitation …
Description check Passed The description follows the repository template. It has a Problem section with the empty-value and two-quote collision, reproduction steps, and the cause at elicitationForm.ts. It has a Change section…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(acp): form choices with matching titles get distinct labels" matches the main change. The raw summary and objectives describe disambiguating colliding titled choices in ACP elicitation forms by quoting their values, so the title names the primary change and its scope. It uses a conventional commit prefix and is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description follows the repository template. It has a Problem section with the empty-value and two-quote collision, reproduction steps, and the cause at elicitationForm.ts. It has a Change section that explains the colliding-only quoting rule. The Scope section links related issues and explains the bug fix, though it does not give a clear reason for the absence of a direct issue link. The Verification section gives focused test evidence, before and after results, screenshots, and a recording. It names the models and harness that did the work. Minor gaps remain: the Scope section does not clearly link the primary bug issue, and the Change section is brief on enum and mapper handling, which the Not in this change section covers.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 9ba2879 and 2a8032c.

Files selected for processing: 3

  • packages/provider-acp/src/server/elicitationForm.test.ts
  • packages/provider-acp/src/server/elicitationForm.ts
  • scripts/scenarios/acp-titled-empty-choice-label.e2e.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.

This branch has not been deployed

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

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant