Skip to main content

Module interaction_hub

Module interaction_hub 

Source
Expand description

In-memory interaction hub - the shared-world replacement for the imperative worker’s pending.json/response.json file polling.

When an agent’s tool execution needs human input (an ask_user_* / present_for_review tool, or a tool-approval prompt), its HubInteractionBackend::ask registers the InteractionRequest with the InteractionHub and awaits a oneshot for the answer. The daemon surfaces open requests over the control channel via InteractionHub::pending and delivers answers with InteractionHub::answer - no filesystem, no polling.

ask blocks the calling tool worker until the request is answered or cancelled; with the tool lane sequential today that serializes interactive agents, which is acceptable (the lane becomes a pool later).

Structs§

HubInteractionBackend
A per-agent InteractionBackend that routes ask through an InteractionHub.
InteractionHub
A process-wide registry of open interactions, keyed by request id. Cheap to clone (shared Arc). Also a bevy Resource so the tick loop’s reflect_interaction_status system can mirror open requests into agent status.