Skip to main content

Module ask_user_tool

Module ask_user_tool 

Source
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:

  1. Generates a unique request ID.
  2. Registers a oneshot::Sender<String> in the shared PendingAskUser registry.
  3. Publishes a KernelEvent::AskUserRequest on the event bus so the frontend can render an input/picker.
  4. 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§

AskUserTool
Tool that lets an agent ask the user a clarifying question during execution.
PendingAskUser
Thread-safe registry of in-flight ask_user requests.