pub struct SubagentManager { /* private fields */ }Expand description
Manages the lifecycle of a collection of subagents.
Implementations§
Source§impl SubagentManager
impl SubagentManager
Sourcepub fn with_provider(self, provider: Arc<dyn Provider>) -> Self
pub fn with_provider(self, provider: Arc<dyn Provider>) -> Self
Attach a provider so spawned subagents run a real agent loop.
Sourcepub fn with_tools(self, tools: Arc<ToolRegistry>) -> Self
pub fn with_tools(self, tools: Arc<ToolRegistry>) -> Self
Attach a tool registry for child agents.
Sourcepub fn spawn(
&mut self,
config: SubagentConfig,
prompt: &str,
parent_workspace: &Path,
) -> Result<SubagentHandle, SubagentError>
pub fn spawn( &mut self, config: SubagentConfig, prompt: &str, parent_workspace: &Path, ) -> Result<SubagentHandle, SubagentError>
Spawn a new subagent with the given config and prompt.
If config.workspace_isolation is true, a work directory is created at
.rx4/worktrees/{id} inside parent_workspace.
When a provider is configured, runs Agent::prompt (blocking the
current thread via a temporary runtime if needed). Otherwise completes
offline with the prompt recorded in the result.
Sourcepub async fn spawn_async(
&mut self,
config: SubagentConfig,
prompt: &str,
parent_workspace: &Path,
) -> Result<SubagentHandle, SubagentError>
pub async fn spawn_async( &mut self, config: SubagentConfig, prompt: &str, parent_workspace: &Path, ) -> Result<SubagentHandle, SubagentError>
Async spawn that runs the agent loop on the current runtime.
Sourcepub fn list(&self) -> Vec<&SubagentHandle>
pub fn list(&self) -> Vec<&SubagentHandle>
List all known subagent handles.
Sourcepub fn get(&self, id: &str) -> Option<&SubagentHandle>
pub fn get(&self, id: &str) -> Option<&SubagentHandle>
Look up a subagent by id.
Sourcepub fn cancel(&mut self, id: &str) -> Result<(), SubagentError>
pub fn cancel(&mut self, id: &str) -> Result<(), SubagentError>
Cancel a running or pending subagent.
Sourcepub async fn wait_all(&self) -> Vec<SubagentResult>
pub async fn wait_all(&self) -> Vec<SubagentResult>
Wait for all subagents to complete and return their results.
Sourcepub fn wait_all_sync(&self) -> Vec<SubagentResult>
pub fn wait_all_sync(&self) -> Vec<SubagentResult>
Synchronous variant of wait_all.
Trait Implementations§
Source§impl Debug for SubagentManager
impl Debug for SubagentManager
Source§impl Default for SubagentManager
impl Default for SubagentManager
Source§fn default() -> SubagentManager
fn default() -> SubagentManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SubagentManager
impl !UnwindSafe for SubagentManager
impl Freeze for SubagentManager
impl Send for SubagentManager
impl Sync for SubagentManager
impl Unpin for SubagentManager
impl UnsafeUnpin for SubagentManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more