Skip to main content

OrchestratorConfig

Struct OrchestratorConfig 

Source
pub struct OrchestratorConfig {
Show 22 fields pub max_turns: usize, pub max_tokens: u32, pub context_strategy: Option<ContextStrategyConfig>, pub summarize_threshold: Option<u32>, pub tool_timeout_seconds: Option<u64>, pub max_tool_output_bytes: Option<usize>, pub run_timeout_seconds: Option<u64>, pub enable_squads: Option<bool>, 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 dispatch_mode: Option<DispatchMode>, pub routing: RoutingMode, pub escalation: bool, pub multi_agent_prompt: Option<bool>, pub spawn: Option<SpawnConfig>, pub max_tokens_in_flight_per_tenant: Option<usize>,
}
Expand description

Orchestrator-level settings with sensible defaults.

Fields§

§max_turns: usize§max_tokens: u32§context_strategy: Option<ContextStrategyConfig>

Context window management strategy for the orchestrator’s own conversation.

§summarize_threshold: Option<u32>

Token threshold for summarization of the orchestrator’s own context.

§tool_timeout_seconds: Option<u64>

Timeout in seconds for the orchestrator’s own tool calls.

§max_tool_output_bytes: Option<usize>

Maximum byte size for tool output on the orchestrator’s own tools.

§run_timeout_seconds: Option<u64>

Wall-clock deadline in seconds for the entire orchestrator run.

§enable_squads: Option<bool>

Enable the form_squad tool for dynamic agent squad formation. When None (default), auto-enabled when there are >= 2 agents. Set to false to disable for a simpler prompt with fewer tokens.

§reasoning_effort: Option<String>

Reasoning/thinking effort level. Enables extended thinking on models that support it (e.g., Qwen3 via OpenRouter, Claude with extended thinking). Valid values: “high”, “medium”, “low”, “none”.

§enable_reflection: Option<bool>

Enable reflection prompts after tool results. When true, the agent pauses to assess tool outputs before deciding the next action (Reflexion/CRITIC pattern).

§tool_output_compression_threshold: Option<usize>

Tool output compression threshold in bytes. Outputs exceeding this size are compressed via an LLM call that preserves factual content.

§max_tools_per_turn: Option<usize>

Maximum number of tool definitions sent per LLM turn. When agents have many tools, filtering to the most relevant reduces context usage and cost.

§tool_profile: Option<String>

Tool profile for pre-filtering tool definitions. Valid values: “conversational”, “standard”, “full”. Defaults to no filtering.

§max_identical_tool_calls: Option<u32>

Maximum consecutive identical tool-call turns before doom loop detection triggers. When reached, tool calls get error results instead of executing.

§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).

§max_tool_calls_per_turn: Option<u32>

Maximum number of tool calls allowed in a single LLM turn. When a turn contains more tool calls than this limit, the excess calls are rejected with an error result (per-turn cap, not cumulative).

§dispatch_mode: Option<DispatchMode>

Dispatch mode for orchestrator delegation. When Sequential, the delegate_task schema constrains maxItems: 1 so the LLM dispatches one agent at a time. Defaults to Parallel when absent.

§routing: RoutingMode

Task routing strategy: auto (default), always_orchestrate, single_agent. auto uses heuristic scoring + capability matching to route simple tasks to a single agent and complex tasks to the orchestrator.

§escalation: bool

Escalate from single-agent to orchestrator on failure. Default: true. When a single-agent run fails with MaxTurnsExceeded, doom loop, or excessive compaction, the task is re-run through the orchestrator.

§multi_agent_prompt: Option<bool>

Append the multi-agent collaboration prompt to sub-agent system prompts. Teaches sub-agents blackboard protocol, dedup, cross-verification, and structured execution. Default: true.

§spawn: Option<SpawnConfig>

Dynamic agent spawning configuration. When present, enables the spawn_agent tool on the orchestrator, allowing the LLM to create specialist agents at runtime.

§max_tokens_in_flight_per_tenant: Option<usize>

Per-tenant in-flight token cap for the TenantTokenTracker. When None, in-flight token tracking is disabled (effectively unbounded). Must be > 0 when set.

Trait Implementations§

Source§

impl Debug for OrchestratorConfig

Source§

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

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

impl Default for OrchestratorConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for OrchestratorConfig

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>,