Skip to content

feat: answer agent elicitations in the chat - #65

Open
Moep90 wants to merge 1 commit into
formulahendry:mainfrom
Moep90:feat/elicitation
Open

Moep90 wants to merge 1 commit into
formulahendry:mainfrom
Moep90:feat/elicitation

Conversation

@Moep90

@Moep90 Moep90 commented Sep 1, 2026

Copy link
Copy Markdown

Problem

ACP lets an agent ask the user for structured input instead of guessing, through session/create_elicitation. The client never advertised the capability and never implemented the method, so a question was refused before it reached anyone. For a user the agent simply proceeds on an assumption.

Related: this is the gap described in zed-industries/zed#48784 and zed-industries/zed#48038, where option payloads arrive but never turn into something clickable.

Change

initialize now advertises elicitation: { form: {} }, and AcpClientImpl.unstable_createElicitation routes the request into the chat.

A question with a single choice property becomes a row of buttons, so one click answers it. Anything else becomes a small form built from the schema, with text, number, checkbox and multi select controls. Send stays disabled until every property listed in required has a value. Declining answers decline, and closing the chat view answers cancel so the agent is never left waiting on a view that is gone.

URL mode is declined, which is why the capability advertises form only.

Testing

npm run lint, npm test and npm run package pass locally on Linux. Three JSDOM tests cover the one click answer and its payload, a form that unlocks Send once the required field is filled and then reports text, number and boolean together, and a declined question that locks the card against further clicks.

Note on overlap

The test file brings its own JSDOM harness and adds jsdom to the dev dependencies, as #56 and #64 do. Whichever lands first, I am happy to rebase onto it and drop the duplicate harness.

ACP lets an agent ask the user for structured input instead of guessing,
but the client never advertised the capability, so the request was refused
before it reached anyone.

The client now advertises elicitation form support during initialize and
renders an incoming request in the chat. A question with a single choice
property becomes a row of buttons, so one click answers it. Anything else
becomes a small form, with text, number, checkbox and multi select controls
built from the schema, and Send stays disabled until every required field
has a value. Declining and closing the chat view are reported back as
decline and cancel.

URL mode is not implemented and is declined, which matches the capability
the client sends.

Signed-off-by: moep90 <volleyballlive@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant