Skip to main content

SubagentResolutionPort

Trait SubagentResolutionPort 

Source
pub trait SubagentResolutionPort: Send + Sync {
    // Required methods
    fn resolve_subagent_model<'life0, 'life1, 'async_trait>(
        &'life0 self,
        subagent_type: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Option<ProviderModelRef>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn resolve_runtime_metadata<'life0, 'life1, 'async_trait>(
        &'life0 self,
        subagent_type: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = HashMap<String, String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn resolve_subagent_prompt(&self, subagent_type: &str) -> String;
}
Expand description

Resolves subagent-type–specific configuration (model, runtime metadata, system prompt) for the SubAgent tool.

Kept separate from ChildSessionPort (session CRUD/lifecycle/state): this port is pure subagent_type → config resolution. The server layer implements it; the tool depends only on the trait, carrying no AppState coupling.

Required Methods§

Source

fn resolve_subagent_model<'life0, 'life1, 'async_trait>( &'life0 self, subagent_type: &'life1 str, ) -> Pin<Box<dyn Future<Output = Option<ProviderModelRef>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provider+model ref for a subagent_type, or None to use defaults.

Source

fn resolve_runtime_metadata<'life0, 'life1, 'async_trait>( &'life0 self, subagent_type: &'life1 str, ) -> Pin<Box<dyn Future<Output = HashMap<String, String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Runtime metadata (e.g. external-agent routing) for a subagent_type.

Source

fn resolve_subagent_prompt(&self, subagent_type: &str) -> String

Canonical system prompt for a subagent_type (falls back to general-purpose for unknown/empty values; never empty).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§