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§
- HubInteraction
Backend - A per-agent
InteractionBackendthat routesaskthrough anInteractionHub. - Interaction
Hub - A process-wide registry of open interactions, keyed by request id. Cheap to
clone (shared
Arc). Also a bevyResourceso the tick loop’sreflect_interaction_statussystem can mirror open requests into agent status.
Constants§
- DEFAULT_
INTERACTION_ TIMEOUT_ SECS - The default deadline on an unanswered prompt, in seconds.