Expand description
ask_user tool — RFC-027 agent-driven clarification.
When the agent encounters ambiguity during execution, it can call this tool to surface a question to the user via a oneshot channel. The tool:
- Generates a unique request ID.
- Registers a
oneshot::Sender<String>in the sharedPendingAskUserregistry. - Publishes a
KernelEvent::AskUserRequeston the event bus so the frontend can render an input/picker. - Awaits the user’s response (delivered via the API response handler that resolves the oneshot) and returns the answer to the agent.
The full WebSocket/API integration for resolving the oneshot is the gateway phase. This module covers the kernel-side plumbing.
Structs§
- AskUser
Tool - Tool that lets an agent ask the user a clarifying question during execution.
- Pending
AskUser - Thread-safe registry of in-flight
ask_userrequests.