Skip to main content

ProfileSpec

Struct ProfileSpec 

Source
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: String

Profile name (directory name). Corresponds to the profile enum variant in spawn_agent.

§dir: PathBuf

Absolute path to the profile directory.

§description: String

Selection 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: String

The 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: bool

When 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: HooksConfig

The [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

Source§

fn clone(&self) -> ProfileSpec

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ProfileSpec

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoMaybeUndefined<T> for T

Source§

impl<T> IntoOption<T> for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more