Skip to main content

SubAgentConfig

Struct SubAgentConfig 

Source
pub struct SubAgentConfig {
Show 32 fields pub name: String, pub description: String, pub system_prompt: String, pub tools: Vec<Arc<dyn Tool>>, pub context_strategy: Option<ContextStrategy>, pub summarize_threshold: Option<u32>, pub tool_timeout: Option<Duration>, 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: Option<Duration>, pub guardrails: Vec<Arc<dyn Guardrail>>, pub provider: Option<Arc<BoxedProvider>>, pub reasoning_effort: Option<ReasoningEffort>, pub enable_reflection: Option<bool>, pub tool_output_compression_threshold: Option<usize>, pub max_tools_per_turn: Option<usize>, pub tool_profile: Option<ToolProfile>, 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_config: Option<SessionPruneConfig>, pub enable_recursive_summarization: Option<bool>, pub reflection_threshold: Option<u32>, pub consolidate_on_exit: Option<bool>, pub workspace: Option<PathBuf>, pub max_total_tokens: Option<u64>, pub audit_trail: Option<Arc<dyn AuditTrail>>, pub audit_user_id: Option<String>, pub audit_tenant_id: Option<String>, pub audit_delegation_chain: Vec<String>,
}
Expand description

Configuration for adding a sub-agent to the orchestrator.

Used by OrchestratorBuilder::sub_agent_full to avoid a long parameter list.

Fields§

§name: String

Unique name for this sub-agent.

§description: String

Human-readable description of what this sub-agent does.

§system_prompt: String

System prompt to give this sub-agent.

§tools: Vec<Arc<dyn Tool>>

Tools available to this sub-agent.

§context_strategy: Option<ContextStrategy>

Context window management strategy for this sub-agent.

§summarize_threshold: Option<u32>

Summarize conversation when message count exceeds this threshold.

§tool_timeout: Option<Duration>

Per-tool execution timeout for this sub-agent.

§max_tool_output_bytes: Option<usize>

Maximum tool output size in bytes for this sub-agent.

§max_turns: Option<usize>

Per-agent turn limit. When None, uses orchestrator default.

§max_tokens: Option<u32>

Per-agent token limit. When None, uses orchestrator default.

§response_schema: Option<Value>

Optional JSON Schema for structured output. When set, the sub-agent receives a synthetic __respond__ tool and returns structured JSON.

§run_timeout: Option<Duration>

Optional per-agent run timeout. When None, no timeout is applied to this sub-agent’s run.

§guardrails: Vec<Arc<dyn Guardrail>>

Guardrails applied to this sub-agent’s LLM calls and tool executions.

§provider: Option<Arc<BoxedProvider>>

Optional per-agent LLM provider override. When None, the sub-agent inherits the orchestrator’s provider. Use this to route sub-agents to different models (e.g., Haiku for cheap tasks, Opus for complex ones).

§reasoning_effort: Option<ReasoningEffort>

Optional reasoning/thinking effort level for this sub-agent.

§enable_reflection: Option<bool>

Enable reflection prompts after tool results for this sub-agent.

§tool_output_compression_threshold: Option<usize>

Tool output compression threshold in bytes for this sub-agent.

§max_tools_per_turn: Option<usize>

Maximum tools per turn for this sub-agent.

§tool_profile: Option<ToolProfile>

Tool profile for pre-filtering tool definitions for this sub-agent.

§max_identical_tool_calls: Option<u32>

Maximum consecutive identical tool-call turns for doom loop detection.

§max_fuzzy_identical_tool_calls: Option<u32>

Maximum consecutive fuzzy-identical tool-call turns for doom loop detection.

§max_tool_calls_per_turn: Option<u32>

Maximum number of tool calls allowed in a single LLM turn (per-turn cap).

§session_prune_config: Option<SessionPruneConfig>

Session pruning configuration for this sub-agent.

§enable_recursive_summarization: Option<bool>

Enable recursive summarization for this sub-agent.

§reflection_threshold: Option<u32>

Memory reflection threshold for this sub-agent.

§consolidate_on_exit: Option<bool>

Run memory consolidation at session end for this sub-agent.

§workspace: Option<PathBuf>

Optional workspace root for this sub-agent’s file tools and system prompt.

§max_total_tokens: Option<u64>

Hard limit on cumulative tokens (input + output) across all turns.

§audit_trail: Option<Arc<dyn AuditTrail>>

Optional audit trail for recording untruncated agent decisions.

§audit_user_id: Option<String>

Optional user ID for multi-tenant audit enrichment.

§audit_tenant_id: Option<String>

Optional tenant ID for multi-tenant audit enrichment.

§audit_delegation_chain: Vec<String>

Delegation chain for audit records (propagated to sub-agents).

Trait Implementations§

Source§

impl Default for SubAgentConfig

Source§

fn default() -> SubAgentConfig

Returns the “default value” for a type. 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