pub struct SubagentProfile {
pub name: String,
pub description: String,
pub instructions: String,
pub model: Option<Model>,
pub config: Option<RunConfig>,
pub tools: Vec<Arc<dyn Tool>>,
pub subagents: Vec<SubagentProfile>,
}Expand description
A named, declarable subagent profile.
Capability fields (instructions / tools / subagents) are
profile-owned — the parent’s values never flow into a delegated session,
so a parent’s bash tool never silently leaks into a reviewer subagent.
Scalar defaults (model / config) inherit from the parent when None.
Fields§
§name: StringMachine name the parent model targets in task({ agent: ... }).
description: StringDelegation guidance shown to the parent model alongside the name.
instructions: StringThe subagent’s system message (the child session’s first message).
model: Option<Model>Profile-owned model. None ⇒ inherit the parent’s model.
config: Option<RunConfig>Profile-owned run config. None ⇒ inherit the parent’s config.
tools: Vec<Arc<dyn Tool>>Profile-owned tools. The parent’s tools do NOT flow into the child.
subagents: Vec<SubagentProfile>Profile-owned subagents (enables recursive delegation). The parent’s subagents do NOT flow into the child.
Implementations§
Source§impl SubagentProfile
impl SubagentProfile
Sourcepub fn new(name: impl Into<String>, instructions: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, instructions: impl Into<String>) -> Self
Build a minimal profile (name + instructions). Other fields default to
inherited / empty. description is left empty (callers can override
with .with_description(...); an empty description renders as
“(no description provided)” in the tool listing).
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set the delegation-guidance description shown to the parent model.
Sourcepub fn with_model(self, model: Model) -> Self
pub fn with_model(self, model: Model) -> Self
Set the profile-owned model (overrides inheritance).
Sourcepub fn with_config(self, config: RunConfig) -> Self
pub fn with_config(self, config: RunConfig) -> Self
Set the profile-owned run config (overrides inheritance).
Sourcepub fn with_subagent(self, subagent: SubagentProfile) -> Self
pub fn with_subagent(self, subagent: SubagentProfile) -> Self
Declare a nested subagent (enables recursive delegation).
Trait Implementations§
Source§impl Clone for SubagentProfile
impl Clone for SubagentProfile
Source§fn clone(&self) -> SubagentProfile
fn clone(&self) -> SubagentProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more