Skip to main content

SubagentManager

Struct SubagentManager 

Source
pub struct SubagentManager { /* private fields */ }
Expand description

Runtime-owned manager for bounded child agent execution.

Implementations§

Source§

impl SubagentManager

Source

pub async fn inspect( &self, agent_id: &SubagentId, ) -> Option<SubagentInspectSession>

Returns a lazy transcript snapshot and live event subscription for one subagent.

Source

pub async fn shutdown(&self)

Cancels all live children owned by this manager and awaits their task handles up to a bounded shutdown timeout.

Source§

impl SubagentManager

Source

pub fn new( parent_session_id: SessionId, config: SubagentConfig, factory: Arc<dyn ChildRuntimeFactory>, ) -> Self

Creates a subagent manager for one parent session.

Source

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.

Source

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.

Source

pub async fn has_active_agents(&self) -> bool

Returns true while any managed child is queued or running.

Source

pub async fn snapshot(&self) -> Vec<SubagentStatusView>

Returns compact status views for all managed children.

Source

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.

Source

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.

Source

pub async fn cancel( &self, agent_ids: &[SubagentId], ) -> Result<WaitSubagentsOutput, RuntimeError>

Cancels selected children and returns their compact statuses.

Source§

impl SubagentManager

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for SubagentManager

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for SubagentManager

§

impl !UnwindSafe for SubagentManager

§

impl Forget for SubagentManager

§

impl Freeze for SubagentManager
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, *const ArcInner<Atomic<bool>> is !null: Freeze, PhantomData<ArcInner<Atomic<bool>>>: Freeze, *const ArcInner<Atomic<usize>> is !null: Freeze, PhantomData<ArcInner<Atomic<usize>>>: Freeze, *const ArcInner<Atomic<u32>> is !null: Freeze, PhantomData<ArcInner<Atomic<u32>>>: Freeze, *const ArcInner<Atomic<u64>> is !null: Freeze, PhantomData<ArcInner<Atomic<u64>>>: Freeze, *const ArcInner<Mutex<SubagentLimitBehavior>> is !null: Freeze, PhantomData<ArcInner<Mutex<SubagentLimitBehavior>>>: Freeze, *const ArcInner<dyn ChildRuntimeFactory> is !null: Freeze, PhantomData<ArcInner<dyn ChildRuntimeFactory>>: Freeze, *const ArcInner<Mutex<SubagentManagerState>> is !null: Freeze, PhantomData<ArcInner<Mutex<SubagentManagerState>>>: Freeze, *const ArcInner<Notify> is !null: Freeze, PhantomData<ArcInner<Notify>>: Freeze, *const ArcInner<Mutex<VecDeque<SubagentStatusView>>> is !null: Freeze, PhantomData<ArcInner<Mutex<VecDeque<SubagentStatusView>>>>: Freeze, *const ArcInner<Mutex<Option<ParentCapabilities>>> is !null: Freeze, PhantomData<ArcInner<Mutex<Option<ParentCapabilities>>>>: Freeze, *const ArcInner<Mutex<Option<Arc<SubagentActivityHub>>>> is !null: Freeze, PhantomData<ArcInner<Mutex<Option<Arc<SubagentActivityHub>>>>>: Freeze, *const ArcInner<Mutex<Option<SubagentEventSink>>> is !null: Freeze, PhantomData<ArcInner<Mutex<Option<SubagentEventSink>>>>: Freeze, *const ArcInner<Mutex<Option<FileSessionStore>>> is !null: Freeze, PhantomData<ArcInner<Mutex<Option<FileSessionStore>>>>: Freeze, *const ArcInner<Mutex<Option<ParentPrimaryModel>>> is !null: Freeze, PhantomData<ArcInner<Mutex<Option<ParentPrimaryModel>>>>: Freeze, *const ArcInner<Mutex<GenerationConfig>> is !null: Freeze, PhantomData<ArcInner<Mutex<GenerationConfig>>>: Freeze, *const ArcInner<TreeNode> is !null: Freeze, PhantomData<ArcInner<TreeNode>>: Freeze,

§

impl Move for SubagentManager

§

impl Send for SubagentManager

§

impl Sync for SubagentManager

§

impl Unpin for SubagentManager

§

impl UnsafeUnpin for SubagentManager
where *const u8 is !null: UnsafeUnpin, PhantomData<u8>: UnsafeUnpin, *const ArcInner<Atomic<bool>> is !null: UnsafeUnpin, PhantomData<ArcInner<Atomic<bool>>>: UnsafeUnpin, *const ArcInner<Atomic<usize>> is !null: UnsafeUnpin, PhantomData<ArcInner<Atomic<usize>>>: UnsafeUnpin, *const ArcInner<Atomic<u32>> is !null: UnsafeUnpin, PhantomData<ArcInner<Atomic<u32>>>: UnsafeUnpin, *const ArcInner<Atomic<u64>> is !null: UnsafeUnpin, PhantomData<ArcInner<Atomic<u64>>>: UnsafeUnpin, *const ArcInner<Mutex<SubagentLimitBehavior>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<SubagentLimitBehavior>>>: UnsafeUnpin, *const ArcInner<dyn ChildRuntimeFactory> is !null: UnsafeUnpin, PhantomData<ArcInner<dyn ChildRuntimeFactory>>: UnsafeUnpin, *const ArcInner<Mutex<SubagentManagerState>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<SubagentManagerState>>>: UnsafeUnpin, *const ArcInner<Notify> is !null: UnsafeUnpin, PhantomData<ArcInner<Notify>>: UnsafeUnpin, *const ArcInner<Mutex<VecDeque<SubagentStatusView>>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<VecDeque<SubagentStatusView>>>>: UnsafeUnpin, *const ArcInner<Mutex<Option<ParentCapabilities>>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<Option<ParentCapabilities>>>>: UnsafeUnpin, *const ArcInner<Mutex<Option<Arc<SubagentActivityHub>>>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<Option<Arc<SubagentActivityHub>>>>>: UnsafeUnpin, *const ArcInner<Mutex<Option<SubagentEventSink>>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<Option<SubagentEventSink>>>>: UnsafeUnpin, *const ArcInner<Mutex<Option<FileSessionStore>>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<Option<FileSessionStore>>>>: UnsafeUnpin, *const ArcInner<Mutex<Option<ParentPrimaryModel>>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<Option<ParentPrimaryModel>>>>: UnsafeUnpin, *const ArcInner<Mutex<GenerationConfig>> is !null: UnsafeUnpin, PhantomData<ArcInner<Mutex<GenerationConfig>>>: UnsafeUnpin, *const ArcInner<TreeNode> is !null: UnsafeUnpin, PhantomData<ArcInner<TreeNode>>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more