You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(acp): keep titled form choices with an empty value and title - #46733
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:
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).
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.
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
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
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.
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
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:XS0-9 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
ACP form elicitations with a titled choice (
oneOf/ arrayanyOf) whoseconstandtitleare 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 ACPEnumOptionschema acceptstitle: ""andconst: "", buttitledOptionrequired a nonblank title or const. One unlabeled entry madechoiceOptionsreject the whole field,parseElicitationFormreturnedundefined, and the adapter's generic path (packages/provider-acp/src/server/adapter.ts,form === undefinedbranch) answered{ action: "decline" }.Deterministic repro on
origin/main(97d727c2364ee4650d705b3ae0eaeb0644ee6c80): an ACP agent sendselicitation/createwith messageConfigure this runand thisrequestedSchema:{"type":"object","required":["mode"],"properties":{"mode":{"type":"string","oneOf":[{"const":"","title":""},{"const":"fast","title":"Fast"}]}}}ElicitationSchemadecodes it,parseElicitationFormreturnsundefined, no question is raised, and the agent receives{ action: "decline" }.{ action: "accept", content: { mode: "" } }.Change
Once
constis confirmed to be a string,titledOptionfalls back to its JSON-quoted form ("") when both the title and trimmed value are blank. The plainenumpath already labels empty values this way. This one helper covers both single-selectoneOfand multi-selectanyOf, 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
packages/provider-acp/src/server/elicitationForm.test.ts. It decodes the fixture with the generatedElicitationSchema, coversoneOfanditems.anyOf, and asserts labels['""', "Fast"], values["", "fast"], andcontent({ mode: "", tags: [""] })→{ mode: "", tags: [""] }.assert(form !== undefined).vp run check:changedexited 0 (format, lint, knip, typecheck across 13 packages, affected tests).{ "action": "decline" }[{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