pub struct SubagentManager { /* private fields */ }Expand description
Runtime-owned manager for bounded child agent execution.
Implementations§
Source§impl SubagentManager
impl SubagentManager
Sourcepub async fn inspect(
&self,
agent_id: &SubagentId,
) -> Option<SubagentInspectSession>
pub async fn inspect( &self, agent_id: &SubagentId, ) -> Option<SubagentInspectSession>
Returns a lazy transcript snapshot and live event subscription for one subagent.
Source§impl SubagentManager
impl SubagentManager
Sourcepub fn new(
parent_session_id: SessionId,
config: SubagentConfig,
factory: Arc<dyn ChildRuntimeFactory>,
) -> Self
pub fn new( parent_session_id: SessionId, config: SubagentConfig, factory: Arc<dyn ChildRuntimeFactory>, ) -> Self
Creates a subagent manager for one parent session.
Sourcepub fn runtime_controlled(
parent_session_id: SessionId,
config: SubagentConfig,
factory: Arc<dyn ChildRuntimeFactory>,
enabled: bool,
) -> Self
pub fn runtime_controlled( parent_session_id: SessionId, config: SubagentConfig, factory: Arc<dyn ChildRuntimeFactory>, enabled: bool, ) -> Self
Creates a manager whose spawn policy can be changed by interactive runtime control.
Sourcepub fn runtime_controlled_at_depth(
parent_session_id: SessionId,
config: SubagentConfig,
factory: Arc<dyn ChildRuntimeFactory>,
enabled: bool,
depth: u8,
) -> Self
pub fn runtime_controlled_at_depth( parent_session_id: SessionId, config: SubagentConfig, factory: Arc<dyn ChildRuntimeFactory>, enabled: bool, depth: u8, ) -> Self
Creates a manager for a child runtime at a known delegation depth.
Sourcepub async fn has_active_agents(&self) -> bool
pub async fn has_active_agents(&self) -> bool
Returns true while any managed child is queued or running.
Sourcepub async fn snapshot(&self) -> Vec<SubagentStatusView>
pub async fn snapshot(&self) -> Vec<SubagentStatusView>
Returns compact status views for all managed children.
Sourcepub async fn spawn(
&self,
tasks: Vec<SubagentTaskSpec>,
max_concurrency: Option<usize>,
parent_token: CancellationToken,
) -> Result<SpawnSubagentsOutput, RuntimeError>
pub async fn spawn( &self, tasks: Vec<SubagentTaskSpec>, max_concurrency: Option<usize>, parent_token: CancellationToken, ) -> Result<SpawnSubagentsOutput, RuntimeError>
Accepts a batch of child tasks, starting only the initial bounded slice.
Sourcepub async fn wait(
&self,
agent_ids: &[SubagentId],
mode: WaitMode,
timeout: Option<Duration>,
) -> Result<WaitSubagentsOutput, RuntimeError>
pub async fn wait( &self, agent_ids: &[SubagentId], mode: WaitMode, timeout: Option<Duration>, ) -> Result<WaitSubagentsOutput, RuntimeError>
Waits for selected children or returns their latest compact statuses on timeout.
Sourcepub async fn cancel(
&self,
agent_ids: &[SubagentId],
) -> Result<WaitSubagentsOutput, RuntimeError>
pub async fn cancel( &self, agent_ids: &[SubagentId], ) -> Result<WaitSubagentsOutput, RuntimeError>
Cancels selected children and returns their compact statuses.
Source§impl SubagentManager
impl SubagentManager
Sourcepub async fn send_message(
&self,
agent_id: &SubagentId,
message: String,
) -> Result<(), RuntimeError>
pub async fn send_message( &self, agent_id: &SubagentId, message: String, ) -> Result<(), RuntimeError>
Sends a follow-up message directly to a subagent session (used by TUI Takeover).
If the subagent is currently running or queued, the message is queued and executes after the current turn settles. If the subagent has reached a terminal state with a retained runtime, a new turn is launched on that same child session.
Sourcepub async fn send_message_with_options(
&self,
agent_id: &SubagentId,
message: String,
options: SendSubagentMessageOptions,
) -> Result<SendSubagentMessageOutput, RuntimeError>
pub async fn send_message_with_options( &self, agent_id: &SubagentId, message: String, options: SendSubagentMessageOptions, ) -> Result<SendSubagentMessageOutput, RuntimeError>
Sends a follow-up instruction to a running child or wakes a terminal
child with its retained transcript and agent_id, returning a typed,
non-ambiguous delivery outcome.