pub struct ProfileSpec {
pub name: String,
pub dir: PathBuf,
pub description: String,
pub model: Option<String>,
pub system_prompt_text: String,
pub tool_allow: Vec<String>,
pub sampling: Option<SamplingParams>,
pub inherit_project_prompt: bool,
pub request_limit: Option<TurnRequestLimit>,
pub hooks: HooksConfig,
}Expand description
A parsed subagent profile.
Produced by discover_profiles; consumed by the spawn_agent tool and the
top-level CLI --profile flag.
Fields§
§name: StringProfile name (directory name). Corresponds to the profile enum variant in
spawn_agent.
dir: PathBufAbsolute path to the profile directory.
description: StringSelection description — spawn_agent uses this to let the LLM decide which
profile to pick; it also goes into the tool description’s catalog. Required.
model: Option<String>Optional model override; omitted ⇒ the sub-agent falls back to the parent session’s currently selected model.
There is no separate provider field: the model ID already uniquely determines
the provider via the provider registry’s entry_for_model, so adding a provider
field would create a second source of truth. To use a specific provider, simply
write a model ID that belongs to that provider.
system_prompt_text: StringThe pre-resolved system prompt text (from [prompt] file).
tool_allow: Vec<String>Tool allowlist — sub-agents can only see these tools. Omitted ⇒
DEFAULT_TOOL_ALLOW.
sampling: Option<SamplingParams>Optional sampling parameter overrides.
inherit_project_prompt: boolWhen true, the subagent’s system prompt is prefixed with the project instruction
layer (AGENTS.md), so it inherits project world-knowledge (build/test/arch
conventions) without inheriting the parent’s identity. Default false (isolation +
token economy). Configured via inherit_project_prompt.
request_limit: Option<TurnRequestLimit>Optional per-turn LLM-call cap. Omitted ⇒ the subagent uses a fixed anti-runaway
default. Configured via request_limit (+ request_limit_mode), the same keys and
semantics as the top-level [turn] config.
hooks: HooksConfigThe [hooks] declared by this profile — hooks attached when a sub-agent runs a
turn.
Consistent with the “inherit world, not identity” principle: a profile’s hooks are
part of its identity, declared in the profile’s own config.toml / frontmatter,
and are not inherited from the parent session. Each entry carries the
ConfigSource of the profile’s layer (replaced when a project layer overrides a
user layer, since the entire ProfileSpec is overridden). Omitted ⇒ empty
(sub-agent has no hooks).
Trait Implementations§
Source§impl Clone for ProfileSpec
impl Clone for ProfileSpec
Source§fn clone(&self) -> ProfileSpec
fn clone(&self) -> ProfileSpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more