Expand description
Agent-initiated dynamic interaction tools: present_for_review,
ask_user_text, ask_user_choice, ask_user_confirm, edit_document.
Unlike interaction_points (declared statically in a blueprint and
always fired), these are ordinary tool calls the model makes on its own
judgment, mid-reasoning. Both the background worker (file-based IPC) and
the foreground (stdin) run modes need to intercept these tool names
before they ever reach the generic tool registry - this module holds
that shared logic behind an InteractionBackend trait so it can be
unit tested with a mock instead of only living inside untestable
closures.
Structs§
- Unattended
Interaction - An
InteractionBackendfor unattended runs: answers every request fromunattended_answerinstead of opening a prompt on the hub.
Constants§
- UNATTENDED_
NO_ ANSWER - What an unattended run tells the model when a question needed a person.
Traits§
- Interaction
Backend - How a dynamically-requested interaction is dispatched and logged.
Functions§
- dispatch_
dynamic_ interaction - Dispatch a single dynamic-interaction tool call.
- gate_
block_ info - Extract
(tool_name, taint, clearance)from a blocked gate decision, orNoneif the decision isn’t a block. - gate_
prompt_ args - Build the approval-prompt arguments explaining why an outbound call was gated.
- map_
gate_ approval - Map an approval outcome (approved, session-scope) to a gate resolution.
- resolve_
gate_ with_ asker - Resolve a foreground taint-gate block by asking via
ask(real stdin in production, a mock in tests) and mapping the response. Kept free of the blocking stdin call itself so the request-building + mapping are testable. - unattended_
answer - The answer an unattended run (
--yolo) gives a request nobody is there to see.