pub struct ParentQueueApprovalHandler {
pub child_agent_id: String,
pub queue: Arc<Mutex<Vec<QueuedApproval>>>,
}Expand description
§2.2 C6 background_prompts = "parent"’s
crate::permissions::PermissionsApprovalHandler: pushes every
Ask-tier request onto the parent’s queue
(crate::agent::Agent::pending_child_approvals) and returns
crate::permissions::ApprovalOutcome::Deny immediately — NEVER
blocks, since a detached background child has no way to wait for an
answer that can’t arrive synchronously (the hard C6 requirement this
whole policy exists to satisfy). “Surfaced to the parent” means exactly
that: recorded for the parent to inspect/audit, not a live prompt the
parent’s later answer retroactively changes.
Fields§
§child_agent_id: StringThis child’s own agent id, stamped on every queued record so the parent can tell multiple background children’s requests apart.
queue: Arc<Mutex<Vec<QueuedApproval>>>The shared queue — the SAME Arc as the parent’s own
pending_child_approvals field, so a push here is immediately
visible to the parent.
Trait Implementations§
Source§impl PermissionsApprovalHandler for ParentQueueApprovalHandler
impl PermissionsApprovalHandler for ParentQueueApprovalHandler
Source§fn ask(&self, req: &ApprovalRequest<'_>) -> ApprovalOutcome
fn ask(&self, req: &ApprovalRequest<'_>) -> ApprovalOutcome
req. Implementations that need to block on
user input (a real TUI prompt) do so here; a scripted/headless
implementation (tests, CI, an --auto-approve flag) returns
immediately.