pub struct AgentConfig {Show 18 fields
pub default_model: String,
pub context_window: usize,
pub reserve_tokens: usize,
pub max_tokens: usize,
pub max_spawn_depth: Option<u8>,
pub subagent_model: Option<String>,
pub fallback_models: Vec<String>,
pub max_tool_repeats: usize,
pub max_tool_errors: u32,
pub tool_retry_on_malformed: bool,
pub session_max_age: u64,
pub session_max_count: usize,
pub post_compaction_sections: Vec<String>,
pub checkpoints_enabled: bool,
pub max_checkpoints: usize,
pub active_memory: ActiveMemoryConfig,
pub permission_level: PermissionLevel,
pub auto_approve_loopback: bool,
}Fields§
§default_model: String§context_window: usize§reserve_tokens: usize§max_tokens: usizeMaximum tokens for LLM response
max_spawn_depth: Option<u8>Maximum depth for spawn_agent tool (default: 1, no nested spawning)
- 0: spawn_agent tool disabled
- 1: single level only (subagents cannot spawn more agents)
- 2+: limited nesting allowed (not recommended)
subagent_model: Option<String>Model to use for spawned subagents (default: same as default_model or claude-cli/sonnet)
fallback_models: Vec<String>Fallback models to try if primary provider fails with retryable errors (rate limits, server errors, timeouts). Providers are tried in order. Example: [“openai/gpt-4o”, “ollama/llama3”]
max_tool_repeats: usizeMaximum times the same tool can be called with identical arguments before loop detection triggers. Default: 3. Set to 0 to disable loop detection.
max_tool_errors: u32Maximum consecutive failures of the same tool before blocking it. Default: 3. Set to 0 to disable tool error tracking.
tool_retry_on_malformed: boolAllow one retry when a tool call has malformed arguments. Default: true. Set to false to fail immediately.
session_max_age: u64Maximum age for session files before pruning (in seconds). 0 = keep forever. Default: 30 days.
session_max_count: usizeMaximum number of sessions to keep per agent. 0 = unlimited. Default: 500.
post_compaction_sections: Vec<String>Sections from AGENTS.md (or SOUL.md) to re-inject after session compaction. Default: [“Session Startup”, “Red Lines”]. Empty array disables injection.
checkpoints_enabled: boolSave checkpoint of session transcript before compaction (enables restore). Default: true.
max_checkpoints: usizeMaximum compaction checkpoints to keep per session. Default: 5.
active_memory: ActiveMemoryConfigActive memory recall configuration — automatically search memory before replies
permission_level: PermissionLevelSession permission level. Tools requiring a higher level need approval. Default: “elevated” (all tools run without prompting, matching current behavior). Set to “safe” to require approval for dangerous tools (bash, file write, etc.).
auto_approve_loopback: boolAuto-approve elevated tool calls from loopback connections (localhost). Default: true (backward compatible — CLI and local HTTP skip approval).
Trait Implementations§
Source§impl Clone for AgentConfig
impl Clone for AgentConfig
Source§fn clone(&self) -> AgentConfig
fn clone(&self) -> AgentConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AgentConfig
impl Debug for AgentConfig
Source§impl Default for AgentConfig
impl Default for AgentConfig
Source§impl<'de> Deserialize<'de> for AgentConfig
impl<'de> Deserialize<'de> for AgentConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for AgentConfig
impl RefUnwindSafe for AgentConfig
impl Send for AgentConfig
impl Sync for AgentConfig
impl Unpin for AgentConfig
impl UnsafeUnpin for AgentConfig
impl UnwindSafe for AgentConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().