pub trait GuardianSpawner: Send + Sync {
// Required method
fn spawn_guardian_review<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_session: &'life1 Session,
review_prompt: String,
model: String,
disabled_tools: Option<BTreeSet<String>>,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Late-bound spawner for the guardian reviewer child.
The runner cannot construct a child directly: the SpawnScheduler is built
after the Agent that drives the runner (a construction-order cycle), so
the terminal gate spawns the reviewer through this trait object, injected
per-request on AgentLoopConfig exactly like auxiliary_model_resolver.
The implementation lives in the server (it captures the already-built
scheduler + child-session adapter); the engine holds only the trait, keeping
the engine free of any dependency on server/AppState types.
Required Methods§
Sourcefn spawn_guardian_review<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_session: &'life1 Session,
review_prompt: String,
model: String,
disabled_tools: Option<BTreeSet<String>>,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn spawn_guardian_review<'life0, 'life1, 'async_trait>(
&'life0 self,
parent_session: &'life1 Session,
review_prompt: String,
model: String,
disabled_tools: Option<BTreeSet<String>>,
) -> Pin<Box<dyn Future<Output = Result<String, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Create a read-only reviewer child for parent_session_id, seeded with
review_prompt, enqueue it to run, and return its session id so the
caller can register a wait on it.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".