pub struct Subagent { /* private fields */ }Expand description
A configured subagent, exposed to the parent as one tool.
Implementations§
Source§impl Subagent
impl Subagent
Sourcepub fn agent(&self) -> &Agent
pub fn agent(&self) -> &Agent
The child itself, for a caller that has to check what it was built with rather than what it was asked for. A child inherits some of its settings from its profile and some from the parent’s provider, and the ones that arrive by the second route have no other witness.
pub fn new(profile: SubagentProfile, agent: Arc<Agent>) -> Result<Self>
Sourcepub fn tool_names(&self) -> Vec<&str>
pub fn tool_names(&self) -> Vec<&str>
The tools this child was actually given, for mecha tools and for
checking that a profile’s allowlist matched anything at all.
Trait Implementations§
Source§impl Tool for Subagent
impl Tool for Subagent
Source§fn runs_a_fresh_conversation(&self) -> bool
fn runs_a_fresh_conversation(&self) -> bool
The property boredom’s rung 3 is looking for: a context that has talked itself into a corner cannot reason its way out of one, and this is the only tool that hands a piece of work to a conversation with none of it.
fn name(&self) -> &str
fn description(&self) -> &str
fn input_schema(&self) -> Value
Source§fn read_only(&self) -> bool
fn read_only(&self) -> bool
Read-only tools skip the approval gate and are safe to run in parallel.
Source§fn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
Declared risk surface. The default is the conservative one for a tool
nobody has classified: assume it does nothing special.
fn call<'life0, 'life1, 'async_trait>(
&'life0 self,
input: Value,
ctx: &'life1 ToolCtx,
) -> Pin<Box<dyn Future<Output = Result<ToolOutput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn carried_state(&self, ctx: &ToolCtx) -> Option<CarriedState>
fn carried_state(&self, ctx: &ToolCtx) -> Option<CarriedState>
State this tool holds that a compaction must not lose. Read more
Source§fn denial_remedy(&self) -> Option<String>
fn denial_remedy(&self) -> Option<String>
How the operator could make a call like the one just refused safe —
one sentence appended to a trifecta denial, or
None when nothing
short of policy would change the answer. Read moreSource§fn fixed_workspace(&self) -> Option<PathBuf>
fn fixed_workspace(&self) -> Option<PathBuf>
Source§fn narrows_surface_to(&self) -> Option<Vec<String>>
fn narrows_surface_to(&self) -> Option<Vec<String>>
Tool names this tool is currently restricting the surface to, if it is
restricting it at all. Read more
Source§fn forget_conversation_state(&self)
fn forget_conversation_state(&self)
Drop state that belonged to the conversation that just ended. Read more
Source§fn guards_closures(&self) -> bool
fn guards_closures(&self) -> bool
Does this handle refuse task closures (
status: done|dropped) on the
model’s behalf? Read morefn spec(&self) -> ToolSpec
Auto Trait Implementations§
impl !RefUnwindSafe for Subagent
impl !UnwindSafe for Subagent
impl Freeze for Subagent
impl Send for Subagent
impl Sync for Subagent
impl Unpin for Subagent
impl UnsafeUnpin for Subagent
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