Skip to main content

AgentLoopConfig

Struct AgentLoopConfig 

Source
pub struct AgentLoopConfig {
Show 40 fields pub max_rounds: usize, pub system_prompt: Option<String>, pub disabled_skill_ids: BTreeSet<String>, pub selected_skill_ids: Option<Vec<String>>, pub selected_skill_mode: Option<String>, pub additional_tool_schemas: Vec<ToolSchema>, pub tool_registry: Arc<ToolRegistry>, pub composition_executor: Option<Arc<CompositionExecutor>>, pub skill_manager: Option<Arc<SkillManager>>, pub skip_initial_user_message: bool, pub storage: Option<Arc<dyn Storage>>, pub persistence: Option<Arc<dyn RuntimeSessionPersistence>>, pub attachment_reader: Option<Arc<dyn AttachmentReader>>, pub metrics_collector: Option<MetricsCollector>, pub model_name: Option<String>, pub fast_model_name: Option<String>, pub fast_model_provider: Option<Arc<dyn LLMProvider>>, pub background_model_name: Option<String>, pub planning_model_name: Option<String>, pub search_model_name: Option<String>, pub compression_instructions: Option<String>, pub summarization_model_name: Option<String>, pub background_model_provider: Option<Arc<dyn LLMProvider>>, pub summarization_model_provider: Option<Arc<dyn LLMProvider>>, pub provider_name: Option<String>, pub provider_type: Option<String>, pub reasoning_effort: Option<ReasoningEffort>, pub app_data_dir: Option<PathBuf>, pub disabled_tools: BTreeSet<String>, pub token_budget: Option<TokenBudget>, pub image_fallback: Option<ImageFallbackConfig>, pub prompt_memory_flags: PromptMemoryFlags, pub max_tool_calls_per_round: usize, pub max_consecutive_failures_per_tool: usize, pub strict_argument_tool_names: Vec<String>, pub per_tool_timeout_secs: u64, pub parallel_batch_timeout_secs: u64, pub permission_mode: Option<PermissionMode>, pub features_dynamic_model_routing: bool, pub auxiliary_model_resolver: Option<Arc<dyn Fn() -> AuxiliaryModelConfig + Send + Sync>>,
}
Expand description

Configuration for the agent loop.

Fields§

§max_rounds: usize§system_prompt: Option<String>§disabled_skill_ids: BTreeSet<String>

Skill IDs that are disabled globally for this execution.

§selected_skill_ids: Option<Vec<String>>

Optional explicit skill selection for this execution. When set, only these skill IDs are considered for skill context and allowlists.

§selected_skill_mode: Option<String>

Optional active skill mode for this execution.

When set, skill discovery prefers skills-<mode> directories over generic directories for the same skill id.

§additional_tool_schemas: Vec<ToolSchema>§tool_registry: Arc<ToolRegistry>§composition_executor: Option<Arc<CompositionExecutor>>§skill_manager: Option<Arc<SkillManager>>§skip_initial_user_message: bool

If true, skip appending the initial user message (already present in session).

§storage: Option<Arc<dyn Storage>>

Optional storage for persisting session changes

§persistence: Option<Arc<dyn RuntimeSessionPersistence>>

Optional runtime persistence for non-authoritative session saves. When set, engine save sites use this instead of storage for writes.

§attachment_reader: Option<Arc<dyn AttachmentReader>>

Optional attachment reader for resolving bamboo-attachment://... references into data: URLs for upstream providers. This must not mutate session storage.

§metrics_collector: Option<MetricsCollector>

Optional asynchronous metrics collector

§model_name: Option<String>

Model name used for metrics attribution

§fast_model_name: Option<String>

Fast/cheap model for lightweight tasks (task evaluation, search, etc.).

Call sites may fall back to model_name when this is unset.

§fast_model_provider: Option<Arc<dyn LLMProvider>>

Optional provider override for lightweight fast-model LLM calls.

§background_model_name: Option<String>

Fast/cheap model for memory/background tasks.

This must not silently fall back to the main interaction model.

§planning_model_name: Option<String>

Model for planning/coordination tasks (task decomposition, architecture). Falls back to model_name when unset.

§search_model_name: Option<String>

Model for search/navigation tasks (grep, file listing, symbol resolution). Falls back to fast_model_name when unset.

§compression_instructions: Option<String>

Custom instructions for conversation summarization, injected into the LLM summary prompt. Lets users control what the summary focuses on.

Resolution order: session-level > config-level > built-in defaults.

§summarization_model_name: Option<String>

Dedicated model for summarization. Falls back to background_model_name.

§background_model_provider: Option<Arc<dyn LLMProvider>>

Optional provider override for memory/background model LLM calls.

When set, memory recall rerank and other memory/background tasks use this provider instead of the shared agent loop provider.

§summarization_model_provider: Option<Arc<dyn LLMProvider>>

Optional provider override for summarization / context compression calls.

When set, conversation/task summarization uses this provider instead of the shared agent loop provider.

§provider_name: Option<String>

Provider routing key used for provider-specific request behavior.

In multi-instance mode this may be the instance id.

§provider_type: Option<String>

Underlying provider type (for example openai, anthropic, copilot).

This is distinct from provider_name so provider-specific behavior can remain correct when routing keys are instance ids.

§reasoning_effort: Option<ReasoningEffort>

Optional request-time reasoning effort override.

§app_data_dir: Option<PathBuf>

Bamboo application data directory (typically ~/.bamboo).

Used by runtime features that persist auxiliary artifacts outside the session store, such as durable plan mode files under ~/.bamboo/plan.

§disabled_tools: BTreeSet<String>

Tool names that should be excluded from schemas sent to the LLM.

§token_budget: Option<TokenBudget>

Token budget for context management (optional, defaults to model’s limits)

§image_fallback: Option<ImageFallbackConfig>

Optional image fallback behavior applied to LLM requests only (never persisted).

This is intended for text-only provider paths where image parts must be degraded (placeholder / OCR / error) without leaking into stored session history or UI.

§prompt_memory_flags: PromptMemoryFlags

Feature flags controlling prompt-time memory injection behavior.

§max_tool_calls_per_round: usize

Maximum tool calls allowed per round (default: 80).

§max_consecutive_failures_per_tool: usize

Maximum consecutive failures per tool before circuit breaker (default: 3).

§strict_argument_tool_names: Vec<String>

Tool names that require strict argument validation.

§per_tool_timeout_secs: u64

Per-tool execution timeout in seconds (default: 120).

§parallel_batch_timeout_secs: u64

Parallel batch execution timeout in seconds (default: 300).

§permission_mode: Option<PermissionMode>

Permission mode for this execution (default: None = use PermissionConfig’s mode).

§features_dynamic_model_routing: bool

Enable dynamic per-round model routing based on task complexity. When true, the pipeline classifies complexity at each round end and stores the result in session metadata.

§auxiliary_model_resolver: Option<Arc<dyn Fn() -> AuxiliaryModelConfig + Send + Sync>>

Optional per-round resolver for auxiliary model settings that should follow live global config rather than stay frozen for the whole run.

The main chat model remains session/request scoped; this hook is only for fast/background/planning/search/summarization helpers.

Trait Implementations§

Source§

impl Default for AgentLoopConfig

Source§

fn default() -> Self

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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