Skip to main content

ExternalChildRunner

Trait ExternalChildRunner 

Source
pub trait ExternalChildRunner: Send + Sync {
    // Required methods
    fn should_handle<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session: &'life1 Session,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn execute_external_child<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        session: &'life1 mut Session,
        job: &'life2 SpawnJob,
        event_tx: Sender<AgentEvent>,
        cancel_token: CancellationToken,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided method
    fn set_escalation_bridge(&self, _bridge: Option<HostBridge>) { ... }
}
Expand description

Trait for external child session runtimes (e.g. A2A, CLI adapters).

Implementors are responsible for emitting AgentEvents via event_tx and respecting the cancel_token.

Required Methods§

Source

fn should_handle<'life0, 'life1, 'async_trait>( &'life0 self, session: &'life1 Session, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns true if this runner should handle the given child session.

Source

fn execute_external_child<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, session: &'life1 mut Session, job: &'life2 SpawnJob, event_tx: Sender<AgentEvent>, cancel_token: CancellationToken, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute the child session using an external runtime.

Provided Methods§

Source

fn set_escalation_bridge(&self, _bridge: Option<HostBridge>)

Bind this runner’s per-run escalation host bridge (#68). A nested worker’s run() installs its OWN host bridge here so the runner can hand it to each grandchild’s drive() AT SPAWN time (captured into the drive task, not read later), letting the grandchild re-proxy a non-bypass approval request UP to its parent run for its whole lifetime — even when it outlives the run that spawned it. Default no-op for runners that don’t escalate (e.g. A2A).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§