pub struct AgentConfig {Show 17 fields
pub compact_context: bool,
pub max_tool_iterations: usize,
pub max_history_messages: usize,
pub max_context_tokens: usize,
pub parallel_tools: bool,
pub tool_dispatcher: String,
pub tool_call_dedup_exempt: Vec<String>,
pub tool_filter_groups: Vec<ToolFilterGroup>,
pub max_system_prompt_chars: usize,
pub thinking: ThinkingConfig,
pub history_pruning: HistoryPrunerConfig,
pub context_aware_tools: bool,
pub eval: EvalConfig,
pub auto_classify: Option<AutoClassifyConfig>,
pub context_compression: ContextCompressionConfig,
pub max_tool_result_chars: usize,
pub keep_tool_context_turns: usize,
}Expand description
Agent orchestration configuration ([agent] section).
Fields§
§compact_context: boolWhen true: bootstrap_max_chars=6000, rag_chunk_limit=2. Use for 13B or smaller models.
max_tool_iterations: usizeMaximum tool-call loop turns per user message. Default: 10.
Setting to 0 falls back to the safe default of 10.
max_history_messages: usizeMaximum conversation history messages retained per session. Default: 50.
max_context_tokens: usizeMaximum estimated tokens for conversation history before compaction triggers.
Uses ~4 chars/token heuristic. When this threshold is exceeded, older messages
are summarized to preserve context while staying within budget. Default: 32000.
parallel_tools: boolEnable parallel tool execution within a single iteration. Default: false.
tool_dispatcher: StringTool dispatch strategy (e.g. "auto"). Default: "auto".
tool_call_dedup_exempt: Vec<String>Tools exempt from the within-turn duplicate-call dedup check. Default: [].
tool_filter_groups: Vec<ToolFilterGroup>Per-turn MCP tool schema filtering groups.
When non-empty, only MCP tools matched by an active group are included in the
tool schema sent to the LLM for that turn. Built-in tools always pass through.
Default: [] (no filtering — all tools included).
max_system_prompt_chars: usizeMaximum characters for the assembled system prompt. When > 0, the prompt
is truncated to this limit after assembly (keeping the top portion which
contains identity and safety instructions). 0 means unlimited.
Useful for small-context models (e.g. glm-4.5-air ~8K tokens → set to 8000).
thinking: ThinkingConfigThinking/reasoning level control. Configures how deeply the model reasons
per message. Users can override per-message with /think:<level> directives.
history_pruning: HistoryPrunerConfigHistory pruning configuration for token efficiency.
context_aware_tools: boolEnable context-aware tool filtering (only surface relevant tools per iteration).
eval: EvalConfigPost-response quality evaluator configuration.
auto_classify: Option<AutoClassifyConfig>Automatic complexity-based classification fallback.
context_compression: ContextCompressionConfigContext compression configuration for automatic conversation compaction.
max_tool_result_chars: usizeMaximum characters for a single tool result before truncation.
Head (2/3) and tail (1/3) are preserved with a truncation marker in the
middle. Set to 0 to disable truncation. Default: 50000.
keep_tool_context_turns: usizeNumber of most recent conversation turns whose full tool-call/result
messages are preserved in channel conversation history. Older turns
keep only the final assistant text. Set to 0 to disable (previous
behavior). Default: 2.
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>,
Source§impl JsonSchema for AgentConfig
impl JsonSchema for AgentConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreAuto 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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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 more