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 its caller until the request is answered or cancelled, which for a person at a keyboard can be a very long time. When the caller is a tool batch it waits off_lane, so a prompt nobody has answered yet costs the tool lane no capacity.

“A very long time” used to mean “for ever”: a run whose operator had walked away sat in WaitingInput until the daemon died, holding its slot the whole time (issue #204). InteractionHub::set_timeout_secs puts a deadline on that wait.

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.

Constants§

DEFAULT_INTERACTION_TIMEOUT_SECS
The default deadline on an unanswered prompt, in seconds.