Skip to main content

AgentBackend

Trait AgentBackend 

Source
pub trait AgentBackend: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn caps(&self) -> AgentCaps;
    fn run<'life0, 'async_trait>(
        &'life0 self,
        turn: AgentTurn,
    ) -> Pin<Box<dyn Future<Output = Result<AgentReply, AgentError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Runs agent turns (design §4.1).

Dropping the future returned by AgentBackend::run must stop the work (and kill any child process): the runtime cancels turns that way.

Required Methods§

Source

fn name(&self) -> &str

Short name for logs and audit (claude, fallback(claude,codex)).

Source

fn caps(&self) -> AgentCaps

What this backend supports natively.

Source

fn run<'life0, 'async_trait>( &'life0 self, turn: AgentTurn, ) -> Pin<Box<dyn Future<Output = Result<AgentReply, AgentError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Runs one turn.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§