pub struct ProfileRunner { /* private fields */ }Expand description
Ergonomic facade for profile-driven child spawns.
Reuses SpawnContext (agent, tools, caches, router, completion handler) —
the same dependency bundle the background scheduler uses.
Implementations§
Source§impl ProfileRunner
impl ProfileRunner
Sourcepub fn new(ctx: SpawnContext) -> Self
pub fn new(ctx: SpawnContext) -> Self
Create a runner over the given spawn context.
Sourcepub async fn run_profile(
&self,
profile: &SubagentProfile,
input: RunProfileInput,
) -> Result<(), String>
pub async fn run_profile( &self, profile: &SubagentProfile, input: RunProfileInput, ) -> Result<(), String>
Run a child session under the given profile via the canonical spawn core.
ANTI-FORK: constructs a SpawnJob and delegates to
crate::sdk::spawn::run_child_spawn; there is no inline execute/finalize.
Sourcepub async fn run_profile_stream(
&self,
profile: &SubagentProfile,
input: RunProfileInput,
) -> Result<Receiver<AgentEvent>, String>
pub async fn run_profile_stream( &self, profile: &SubagentProfile, input: RunProfileInput, ) -> Result<Receiver<AgentEvent>, String>
Run a child session under the given profile and return a receiver of the
child’s AgentEvent stream.
The receiver is subscribed from the existing broadcast infra
(ctx.session_event_senders) before the spawn is started, so no events
are missed. This reuses the canonical broadcast channel — it does NOT
invent a parallel RunOutcomeStream/status_rx mpsc.