Skip to main content

Module dynamic_interaction

Module dynamic_interaction 

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

UnattendedInteraction
An InteractionBackend for unattended runs: answers every request from unattended_answer instead 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§

InteractionBackend
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, or None if 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.