pub struct SpawnSubagentTool { /* private fields */ }Expand description
Tool that spawns and runs a subagent to handle an isolated task.
The LLM calls this tool with a subagent type and task description. The tool creates an isolated agent with its own ReAct loop, runs it, and returns the result back to the parent agent.
Implementations§
Source§impl SpawnSubagentTool
impl SpawnSubagentTool
Sourcepub fn new(
manager: Arc<SubagentManager>,
tool_registry: Arc<ToolRegistry>,
http_client: Arc<AdaptedClient>,
session_dir: PathBuf,
parent_model: impl Into<String>,
working_dir: impl Into<String>,
) -> Self
pub fn new( manager: Arc<SubagentManager>, tool_registry: Arc<ToolRegistry>, http_client: Arc<AdaptedClient>, session_dir: PathBuf, parent_model: impl Into<String>, working_dir: impl Into<String>, ) -> Self
Create a new spawn subagent tool.
Sourcepub fn with_event_sender(self, tx: UnboundedSender<SubagentEvent>) -> Self
pub fn with_event_sender(self, tx: UnboundedSender<SubagentEvent>) -> Self
Set the event channel for progress reporting.
Sourcepub fn with_parent_max_tokens(self, max_tokens: u64) -> Self
pub fn with_parent_max_tokens(self, max_tokens: u64) -> Self
Set the parent agent’s max_tokens (subagents inherit this as fallback).
Sourcepub fn with_parent_reasoning_effort(self, effort: Option<String>) -> Self
pub fn with_parent_reasoning_effort(self, effort: Option<String>) -> Self
Set the parent agent’s reasoning effort (subagents inherit this).
Trait Implementations§
Source§impl BaseTool for SpawnSubagentTool
impl BaseTool for SpawnSubagentTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description shown to the LLM.
Source§fn parameter_schema(&self) -> Value
fn parameter_schema(&self) -> Value
JSON Schema describing the tool’s parameters. Read more
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: HashMap<String, Value>,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
args: HashMap<String, Value>,
ctx: &'life1 ToolContext,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the tool with the given arguments and context.
Source§fn format_validation_error(&self, errors: &[ValidationError]) -> Option<String>
fn format_validation_error(&self, errors: &[ValidationError]) -> Option<String>
Format a validation error into a tool-specific, LLM-friendly message. Read more
Source§fn display_meta(&self) -> Option<ToolDisplayMeta>
fn display_meta(&self) -> Option<ToolDisplayMeta>
Return TUI display metadata for this tool. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SpawnSubagentTool
impl !UnwindSafe for SpawnSubagentTool
impl Freeze for SpawnSubagentTool
impl Send for SpawnSubagentTool
impl Sync for SpawnSubagentTool
impl Unpin for SpawnSubagentTool
impl UnsafeUnpin 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