pub struct SpawnSubAgentTool {
pub work_dir: PathBuf,
pub source_root: PathBuf,
pub llm_client: Arc<dyn LlmClient>,
pub event_tx: Option<UnboundedSender<AgentEvent>>,
pub registry: Arc<SubAgentRegistry>,
pub background_tx: Option<UnboundedSender<BackgroundResult>>,
}Expand description
Tool that lets the main agent spawn a subagent for a focused task.
The subagent runs in its own context window, does its work, and returns results to the caller. Subagents cannot spawn other subagents.
The agent can either reference a registered subagent by name, or provide an inline definition with a custom prompt and tool restrictions.
Fields§
§work_dir: PathBuf§source_root: PathBuf§llm_client: Arc<dyn LlmClient>§event_tx: Option<UnboundedSender<AgentEvent>>§registry: Arc<SubAgentRegistry>§background_tx: Option<UnboundedSender<BackgroundResult>>When set, background subagent results are sent back through this channel so the parent agent loop can inject them into its conversation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SpawnSubAgentTool
impl !RefUnwindSafe for SpawnSubAgentTool
impl Send for SpawnSubAgentTool
impl Sync for SpawnSubAgentTool
impl Unpin for SpawnSubAgentTool
impl UnsafeUnpin for SpawnSubAgentTool
impl !UnwindSafe for SpawnSubAgentTool
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