agent: Add ask_user tool using elicitation forms - #61497
Merged
ChristopherBiscardi merged 5 commits intoAug 17, 2026
Merged
Conversation
|
We require contributors to sign our Contributor License Agreement, and we don't have @e-r-w on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'. |
Contributor
Author
|
@cla-bot check |
|
The cla-bot has been summoned, and re-checked this pull request! |
e-r-w
force-pushed
the
agent-ask-user-elicitation
branch
2 times, most recently
from
August 6, 2026 02:04
3b22caa to
e508dc1
Compare
Contributor
Author
|
@ChristopherBiscardi any thoughts on this? I love the zed agent and this would bring it up to speed with the other ACP agents |
e-r-w
force-pushed
the
agent-ask-user-elicitation
branch
from
August 7, 2026 02:47
e508dc1 to
edc45c1
Compare
ChristopherBiscardi
approved these changes
Aug 17, 2026
|
Until finally huehuehue Tks! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Summary
Adds a first-party
ask_usertool to Zed's native agent (crates/agent) that lets the agent ask the user a question and get an answer back through a proper elicitation form rather than free-form chat text.This is a step towards the interactive-question experience requested in discussion #48784 (implement the ACP elicitation spec for agent questions). Zed already renders elicitation forms client-side; this wires the native agent up to that existing rail so the agent can drive single-select and/or free-text prompts.
What it does
The tool takes:
question— the prompt shown to the useroptions— optional list of selectable choices (single-select)allow_free_text— whether the user may type a custom answer instead of picking an optionThe agent decides the shape of each question:
optionsallow_free_textfalsetruetrueA typed answer takes precedence over a selected option, and the tool always resolves (a cancelled or failed elicitation is reported back to the agent rather than hanging).
Demo
Screen.Recording.2026-07-24.at.9.57.02.am.mov
Implementation
thread.rs— newThreadEvent::Elicitation(ElicitationRequest)variant plusToolCallEventStream::request_elicitation, mirroring the existingprompt_for_decisionpermission rail.agent.rs— handles the elicitation event by building a session-scopedacp::CreateElicitationRequestand routing it throughAcpThread::request_elicitation, piping the response back to the tool.tools/ask_user_tool.rs— the tool itself, including schema construction and response extraction.writeandaskprofiles and excluded from the tool-permissions setup UI.No client-side UI changes were needed — the existing elicitation form rendering handles it.
Tests
cargo test -p agent ask_user— 5 unit tests covering schema construction, validation, and accept/decline/cancel handling.Release Notes:
ask_usertool that lets the agent ask the user a question with selectable options and/or free-text input, rendered as an elicitation form