pub struct SubagentProfile {
pub description: String,
pub model: Option<String>,
pub system_prompt: String,
pub tool_allow: Vec<String>,
pub sampling: Option<SamplingParams>,
pub hooks: Option<Arc<dyn HookEngine>>,
}Expand description
A subagent profile that can be invoked by spawn_agent (agent-side representation).
ProfileSpec in defect-config is the source of truth on the config side; the CLI
projects it into this struct during assembly before handing it to the tool. The two
are kept separate because defect-config depends on defect-agent — the agent cannot
depend on config in the opposite direction, or a cycle would result.
Fields§
§description: StringSelection-time description that goes into the tool schema’s catalog, allowing the LLM to choose a profile based on it.
model: Option<String>Optional model override; None falls back to the parent session’s currently
selected model (ctx.current_model).
system_prompt: StringThe full system prompt for this profile.
tool_allow: Vec<String>Tool allowlist — the child agent can only see these tools (spawn_agent is always
excluded).
sampling: Option<SamplingParams>Optional sampling overrides.
hooks: Option<Arc<dyn HookEngine>>The hook engine for this profile — hooks that run when a sub-agent executes a turn.
Consistent with the “inherit world, not identity” principle: hooks belong to the
profile’s identity and are declared by the profile’s own configuration (the CLI
assembles ProfileSpec.hooks into an engine at build time). They are not
inherited from the parent session. None means the sub-agent has no hooks (falls
back to NoopHookEngine), preserving exactly the same behavior as before —
existing profiles without hooks are unaffected.
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