Skip to main content

AgentConfig

Struct AgentConfig 

Source
pub struct AgentConfig {
Show 35 fields pub name: String, pub description: String, pub system_prompt: String, pub template: Option<String>, pub skills: Vec<String>, pub mcp_servers: Vec<McpServerEntry>, pub a2a_agents: Vec<McpServerEntry>, pub context_strategy: Option<ContextStrategyConfig>, pub summarize_threshold: Option<u32>, pub tool_timeout_seconds: Option<u64>, pub max_tool_output_bytes: Option<usize>, pub max_turns: Option<usize>, pub max_tokens: Option<u32>, pub response_schema: Option<Value>, pub run_timeout_seconds: Option<u64>, pub provider: Option<AgentProviderConfig>, pub reasoning_effort: Option<String>, pub enable_reflection: Option<bool>, pub tool_output_compression_threshold: Option<usize>, pub max_tools_per_turn: Option<usize>, pub tool_profile: Option<String>, pub max_identical_tool_calls: Option<u32>, pub max_fuzzy_identical_tool_calls: Option<u32>, pub max_tool_calls_per_turn: Option<u32>, pub session_prune: Option<SessionPruneConfigToml>, pub recursive_summarization: Option<bool>, pub reflection_threshold: Option<u32>, pub consolidate_on_exit: Option<bool>, pub max_total_tokens: Option<u64>, pub guardrails: Option<GuardrailsConfig>, pub response_cache_size: Option<usize>, pub mcp_resources: McpResourceMode, pub dangerous_tools: bool, pub audit_mode: Option<String>, pub builtin_tools: Option<Vec<String>>,
}
Expand description

A sub-agent defined in the configuration file.

Fields§

§name: String§description: String§system_prompt: String§template: Option<String>

Agent template to use as a base. The template provides default values for system_prompt, max_tokens, max_turns, and other settings. User-specified values override template defaults.

§skills: Vec<String>

Skills to auto-inject into the system prompt at config resolution time. Each skill name maps to a bundled or filesystem SKILL.md file.

§mcp_servers: Vec<McpServerEntry>§a2a_agents: Vec<McpServerEntry>

A2A agent endpoints to discover and register as tools.

§context_strategy: Option<ContextStrategyConfig>

Context window management strategy for this agent.

§summarize_threshold: Option<u32>

Token threshold at which to trigger automatic summarization. Only valid when context_strategy is not SlidingWindow.

§tool_timeout_seconds: Option<u64>

Timeout in seconds for individual tool executions.

§max_tool_output_bytes: Option<usize>

Maximum byte size for individual tool output. Results exceeding this limit are truncated with a [truncated] suffix.

§max_turns: Option<usize>

Per-agent turn limit. Overrides the orchestrator default when set.

§max_tokens: Option<u32>

Per-agent token limit. Overrides the orchestrator default when set.

§response_schema: Option<Value>

Optional JSON Schema for structured output. Expressed as an inline TOML table that maps to the JSON Schema object. When set, the agent receives a synthetic __respond__ tool and returns structured JSON.

§run_timeout_seconds: Option<u64>

Wall-clock deadline in seconds for this agent’s run.

§provider: Option<AgentProviderConfig>

Optional per-agent LLM provider override. When set, this agent uses a different model/provider instead of the orchestrator’s default.

§reasoning_effort: Option<String>

Reasoning/thinking effort level. Overrides the orchestrator default. Valid values: “high”, “medium”, “low”, “none”.

§enable_reflection: Option<bool>

Enable reflection prompts after tool results. Overrides the orchestrator default.

§tool_output_compression_threshold: Option<usize>

Tool output compression threshold in bytes. Overrides the orchestrator default.

§max_tools_per_turn: Option<usize>

Maximum tools per turn for this agent. Overrides the orchestrator default.

§tool_profile: Option<String>

Tool profile for pre-filtering tool definitions. Valid values: “conversational” (memory + question only), “standard” (builtins only), “full” (all tools). When absent, no pre-filtering is applied.

§max_identical_tool_calls: Option<u32>

Maximum consecutive identical tool-call turns before doom loop detection. Overrides the orchestrator default.

§max_fuzzy_identical_tool_calls: Option<u32>

Maximum consecutive fuzzy-identical tool-call turns before doom loop detection. Fuzzy matching compares sorted tool names (ignoring inputs). Overrides orchestrator default.

§max_tool_calls_per_turn: Option<u32>

Maximum number of tool calls allowed in a single LLM turn. Overrides the orchestrator default.

§session_prune: Option<SessionPruneConfigToml>

Session pruning: truncate old tool results to save tokens. When set, enables session-level pruning before each LLM call.

§recursive_summarization: Option<bool>

Enable recursive (cluster-then-summarize) summarization for long conversations.

§reflection_threshold: Option<u32>

Cumulative importance threshold for memory reflection triggers. When the sum of stored memory importance values exceeds this threshold, the store tool appends a reflection hint to guide the agent.

§consolidate_on_exit: Option<bool>

When true, run memory consolidation at session end (clusters related episodic memories into semantic summaries). Requires memory and adds LLM calls at session end.

§max_total_tokens: Option<u64>

Hard limit on cumulative tokens (input + output) across all turns. When exceeded, the agent returns an error with partial usage data.

§guardrails: Option<GuardrailsConfig>

Per-agent guardrails override. When set, overrides the top-level [guardrails] section for this agent.

§response_cache_size: Option<usize>

LRU response cache capacity (number of entries). When set, identical LLM requests (same system prompt, messages, tool names) return cached responses without calling the LLM. Only non-streaming calls are cached.

§mcp_resources: McpResourceMode

How MCP resources are surfaced to the agent. "tools" (default) — resources become callable tools. "context" — pre-fetch and inject into system prompt. "none" — skip resource discovery.

§dangerous_tools: bool

Enable dangerous tools (bash) for this agent. Default: false in daemon mode.

§audit_mode: Option<String>

Audit mode: “full” (default) or “metadata_only”. MetadataOnly strips user content from audit records.

§builtin_tools: Option<Vec<String>>

Optional allowlist of builtin tool names for this agent. When set, only listed builtins are included. When absent, all builtins load. Empty list [] disables all builtins (MCP-only agent).

Implementations§

Source§

impl AgentConfig

Source

pub fn clone_config(&self) -> Self

Clone all fields of this config into a new AgentConfig.

AgentConfig intentionally does not derive Clone (to keep the derive list short and avoid accidental copies in hot paths). Use this method when an explicit copy is needed (e.g., template resolution).

Trait Implementations§

Source§

impl Debug for AgentConfig

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for AgentConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. 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> 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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,