pub struct RunnerConfig {
pub max_iterations: usize,
pub max_duration: Duration,
pub compaction_threshold: usize,
pub compaction_keep_recent: usize,
pub retry: RetryConfig,
pub checkpoint_interval: Option<usize>,
pub emit_events: bool,
pub observability: ObservabilityConfig,
}Expand description
Configuration for the AgentRunner loop.
Controls iteration limits, context compaction, retry behavior, and checkpointing intervals.
Fields§
§max_iterations: usizeMaximum number of tool-call iterations before the loop terminates.
Prevents runaway executions.
Default: 25 (zeroclaw uses configurable max_tool_iterations)
max_duration: DurationMaximum wall-clock duration for the entire run. Default: 10 minutes
compaction_threshold: usizeNumber of messages in history before auto-compaction triggers. When exceeded, older messages are summarized into a single context message. Default: 40 messages
compaction_keep_recent: usizeHow many messages to keep verbatim after compaction. The rest are summarized. Default: 10 (keep the 10 most recent messages)
retry: RetryConfigRetry configuration for transient errors.
checkpoint_interval: Option<usize>Checkpoint every N steps. None disables periodic checkpointing.
Default: Some(5)
emit_events: boolWhether to emit verbose stream events for each iteration. Default: true
observability: ObservabilityConfigObservability configuration
Implementations§
Source§impl RunnerConfig
impl RunnerConfig
Sourcepub fn interactive() -> Self
pub fn interactive() -> Self
Create a config tuned for short, interactive sessions.
Sourcepub fn long_running() -> Self
pub fn long_running() -> Self
Create a config tuned for long-running background agents.
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Set the model name for cost calculation
Sourcepub fn with_debug_logging(self) -> Self
pub fn with_debug_logging(self) -> Self
Enable full prompt/response logging (debug mode)
Trait Implementations§
Source§impl Clone for RunnerConfig
impl Clone for RunnerConfig
Source§fn clone(&self) -> RunnerConfig
fn clone(&self) -> RunnerConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more