Skip to content

fix(acp): keep titled form choices with an empty value and title - #46733

Merged
juliusmarminge merged 2 commits into
pingdotgg:mainfrom
saphid:hunter/c-4062d13c60
Dec 1, 2026
Merged

juliusmarminge merged 2 commits into
pingdotgg:mainfrom
saphid:hunter/c-4062d13c60

Conversation

@saphid

@saphid saphid commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Problem

ACP form elicitations with a titled choice (oneOf / array anyOf) whose const and title are both empty strings are declined outright, so the user never sees the question and can't pick any of its other valid choices. The generated ACP EnumOption schema accepts title: "" and const: "", but titledOption required a nonblank title or const. One unlabeled entry made choiceOptions reject the whole field, parseElicitationForm returned undefined, and the adapter's generic path (packages/provider-acp/src/server/adapter.ts, form === undefined branch) answered { action: "decline" }.

Deterministic repro on origin/main (97d727c2364ee4650d705b3ae0eaeb0644ee6c80): an ACP agent sends elicitation/create with message Configure this run and this requestedSchema:

{"type":"object","required":["mode"],"properties":{"mode":{"type":"string","oneOf":[{"const":"","title":""},{"const":"fast","title":"Fast"}]}}}
  • Observed: ElicitationSchema decodes it, parseElicitationForm returns undefined, no question is raised, and the agent receives { action: "decline" }.
  • Expected: both options are shown, the empty one with a nonempty fallback label, and picking it returns { action: "accept", content: { mode: "" } }.

Change

Once const is confirmed to be a string, titledOption falls back to its JSON-quoted form ("") when both the title and trimmed value are blank. The plain enum path already labels empty values this way. This one helper covers both single-select oneOf and multi-select anyOf, so the generic ACP form question on web, desktop and mobile gets the fix. No client changes are needed.

Scope

Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.

Verification

  • Added a regression case to packages/provider-acp/src/server/elicitationForm.test.ts. It decodes the fixture with the generated ElicitationSchema, covers oneOf and items.anyOf, and asserts labels ['""', "Fast"], values ["", "fast"], and content({ mode: "", tags: [""] }) → { mode: "", tags: [""] }.
    • Base: fails at assert(form !== undefined).
    • Head: passes (14/14 in the file).
  • vp run check:changed exited 0 (format, lint, knip, typecheck across 13 packages, affected tests).
  • Before/after runtime transcript (real schema decode → parser → adapter response mapping): https://gist.github.com/saphid/0ecdd4c9e52a68c7d1d2081389743477
    • Base: { "action": "decline" }
    • Head: options [{label:'""',value:""},{label:"Fast",value:"fast"}], response { "action": "accept", "content": { "mode": "" } }

Not shown: no end-to-end run with a live ACP agent and no client screenshots. The question card renders the parser's options unchanged, so only the parser output changes.

Authored by Claude Opus 5.5 (Model Hub); reviewed by GPT-6.2 Sol (Codex).

Not shown

  • packages/provider-acp/src/server/adapter.ts:8863 — The linked probe reproduces the response mapping but does not invoke the adapter or capture an ACP wire response. Call it a parser probe with mirrored response mapping; for a scenarios:prove-ready repro, give the complete JSON-RPC request and steps for sending it from a fixture agent during an active session with form elicitation advertised.
  • scripts/check-changed.ts:1 — The successful check:changed run is author-reported; no HEAD-stamped check log was supplied for independent verification. Attach the exit-0 transcript for c4d7b98842a826d63b4a85fad56e379fd8927dad if available.

@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels Dec 1, 2026
@macroscopeapp

macroscopeapp Bot commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 5f7e931

Macroscope's review found this PR approvable — This preserves ACP form choices with empty titles and values by displaying a quoted fallback label. The change is narrowly scoped and retains existing answer validation and raw values.

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

@coderabbitai

coderabbitai Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5f7e931 and b5ecc47.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The option parser now retains string choices with empty titles and values. Tests cover those choices in single-choice and multi-select forms and verify that submitted content preserves the empty answers.

Changes: Elicitation choice parsing

Layer / File(s) Summary
Option parsing and validation
packages/provider-acp/src/server/elicitationForm.ts, packages/provider-acp/src/server/elicitationForm.test.ts
titledOption falls back to the JSON-encoded string value when the title and trimmed value are blank. Tests decode schemas and verify that empty choices appear with the "" label and remain in submitted content.

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

Change: Bug fix

Suggested reviewers: juliusmarminge

Merge Risk: Minimal · previous review 5f7e9

This change keeps form choices with an empty value and title from being dropped, so forms containing them are no longer automatically declined. The change is small and tested, and no merge-blocking risk is identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: titled ACP form choices with an empty value and title are kept instead of causing the whole form to be declined. It matches the summary (titledOption now falls back to the …
Description check Passed The description follows the template's sections: Problem, Change, Scope, and Verification. It explains the bug with a deterministic repro and expected behavior, and it describes the fix. Scope explain…
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 names the change: titled ACP form choices with an empty value and title are kept instead of causing the whole form to be declined. It matches the summary (titledOption now falls back to the JSON-quoted const label when title and value are blank). It follows the conventional commit style and is specific enough for a teammate scanning history.

Full details: Description check

Explanation

The description follows the template's sections: Problem, Change, Scope, and Verification. It explains the bug with a deterministic repro and expected behavior, and it describes the fix. Scope explains why no issue is needed. Verification lists the focused regression test with base and head results, the check:changed run, and a runtime transcript. It also states what was not checked: no live ACP agent run and no client screenshots. The template does not require a model attribution line, but the author includes one. Two reviewer notes remain: the adapter-level path is shown only through a parser probe, and the check:changed exit-0 result is author-reported without an attached log.

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 ed721f7 and 5f7e931.

Files selected for processing: 2

  • packages/provider-acp/src/server/elicitationForm.test.ts
  • packages/provider-acp/src/server/elicitationForm.ts

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

@juliusmarminge juliusmarminge added the takeover:in-progress A takeover lead is working on this PR label Dec 1, 2026
@juliusmarminge

Copy link
Copy Markdown
Member

Evidence

Environment: real web client in Chromium, 1280×800, light theme, isolated fresh server state on each commit. The existing repository ACP fixture is the same fixture used in triage.

On fresh databases on each commit, register the repository's existing acp-mock-agent.ts as Local ACP command providers (Elicit Fixture), send “Configure this run” in separate threads with the reported single-select blank-title schema, the Default-title control, and the reported multi-select schema. Open each thread in the web client. Capture the question state; when offered, choose the empty-string option (and click Submit for multi-select). Read the fixture's actual elicitation response logs.

Scenario: ACP preserves choices with an empty value and title

Proven: the scenario fails on base 2a314357ad and passes on head b5ecc4783b.

Base 2a314357ad Head b5ecc4783b
Result ❌ failed
ASSERTION_FAILED: expected {"single":{"action":"decline"},"control":{"action":"accept","content":{"mode":""}},"multi":{"action":"decline"}} to equal {"single":{"action":"accept","content":{"mode":""}},"control":{"action":"accept","content":{"mode":""}},"multi":{"action":"accept","content":{"tags":[""]}}}
✅ passed
single choices Base 2a314357ad: single choices Head b5ecc4783b: single choices
control choices Base 2a314357ad: control choices Head b5ecc4783b: control choices
multi choices Base 2a314357ad: multi choices Head b5ecc4783b: multi choices
failure Base 2a314357ad: failure
multi empty selected Head b5ecc4783b: multi empty selected

| Recording | Before | After |

Scenario source · Base response payloads · Head response payloads

Base silently declines both blank-title forms. Head offers "" and Fast, accepts { mode: "" } and { tags: [""] }. The Default-title control accepts { mode: "" } on both.

Not shown:

  • Native desktop and mobile clients were not exercised; this proof covers the shared ACP parser through the real web client.

@juliusmarminge juliusmarminge added takeover:ready Takeover done; auto-lands when gates pass and removed takeover:in-progress A takeover lead is working on this PR labels Dec 1, 2026
@juliusmarminge
juliusmarminge merged commit 4025a2f into pingdotgg:main Dec 1, 2026
59 checks passed
@juliusmarminge juliusmarminge removed the takeover:ready Takeover done; auto-lands when gates pass label Dec 1, 2026
imetn added a commit to imetn/t4code that referenced this pull request Dec 2, 2026
…ce-control & server fixes)

Ported 15 commits from 772e3d4..1e6e7d7:
- ff548ac (pingdotgg#46552), 4025a2f (pingdotgg#46733), abf106f (pingdotgg#46759), c4f3661 (pingdotgg#46960), 5cac91c (pingdotgg#47138)
- 7cf7446 (pingdotgg#46736 mobile Usage filter env 'all', Lock pingdotgg#5 icons preserved)
- 0a5e0e3 (pingdotgg#46848 Android saved route priority)
- b6ac305 (pingdotgg#47096 mobile Git branch grapheme/flag cuts)
- 946d88b (pingdotgg#47098 mobile SVG pixel dimensions)
- c3faadd (pingdotgg#45111 mobile confirm stop once per run)
- a32c694 (pingdotgg#43968 PR Author menu replaces typed author qualifier)
- 6baa47d (pingdotgg#46934 preserve repeated JSON keys in tool output)
- aef9eb9 (pingdotgg#46497 Forgejo PR org labels)
- c57dd42 (pingdotgg#47143 Forgejo issue detail newest comments)
- a7256d6 (pingdotgg#46622 GitLab multiline issue titles)
(Note: pingdotgg#46702 8184b93 already functionally present via useOpenOrReturnToThread.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 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.

2 participants