pub struct QueuedApprovalHandler { /* private fields */ }Expand description
Queued approval handler: enqueue each request and let the UI render one prompt at a time, then return the user’s decision.
Unlike AutoApprovalHandler (a pure strategy) this never decides on its
own and never touches the terminal. It pushes the request into a queue the
UI drains and waits on a per-request oneshot. Parallel sub-agents each call
approve; the queue serializes them so only one prompt is shown at a time
(fixing interleaved multi-sub-agent prompts in REPL UIs).
Implementations§
Source§impl QueuedApprovalHandler
impl QueuedApprovalHandler
Sourcepub fn new(queue_tx: UnboundedSender<ApprovalItem>) -> Self
pub fn new(queue_tx: UnboundedSender<ApprovalItem>) -> Self
Create a handler wired to queue_tx. The caller keeps the matching
UnboundedReceiver and feeds it to the UI.
Trait Implementations§
Source§impl ApprovalHandler for QueuedApprovalHandler
impl ApprovalHandler for QueuedApprovalHandler
fn approve<'life0, 'async_trait>(
&'life0 self,
request: ApprovalRequest,
cancel_token: CancellationToken,
) -> Pin<Box<dyn Future<Output = AgentResult<ApprovalDecision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§impl Clone for QueuedApprovalHandler
impl Clone for QueuedApprovalHandler
Auto Trait Implementations§
impl Freeze for QueuedApprovalHandler
impl RefUnwindSafe for QueuedApprovalHandler
impl Send for QueuedApprovalHandler
impl Sync for QueuedApprovalHandler
impl Unpin for QueuedApprovalHandler
impl UnsafeUnpin for QueuedApprovalHandler
impl UnwindSafe for QueuedApprovalHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more