pub struct AconConfig {
pub enabled: bool,
pub passthrough_threshold: usize,
pub summarize_threshold: usize,
pub total_budget: usize,
pub summarize_provider: ProviderName,
}Expand description
Token budget configuration for Acon tool-result compression (#4021).
Controls per-result and batch-level token budgets for tool outputs injected into context.
Distinct from [tools.compression] (TACO), which applies regex-based rule compression
at the executor level.
§Invariants
The following ordering must hold: passthrough_threshold < summarize_threshold <= total_budget.
A config where passthrough_threshold >= summarize_threshold would make the summarization path
unreachable, silently producing incorrect compression behavior.
§Example (TOML)
[memory.compression.acon]
enabled = true
passthrough_threshold = 2000
summarize_threshold = 4000
total_budget = 8000Fields§
§enabled: boolEnable Acon tool-result compression. Default: true.
passthrough_threshold: usizeToken count below which results pass through unchanged.
Also the truncation target: results above this get char-truncated to this size.
Must be < summarize_threshold. Default: 2000.
summarize_threshold: usizeToken count above which LLM summarization should be attempted before truncation.
Must be > passthrough_threshold and <= total_budget. Default: 4000.
total_budget: usizeMaximum total tokens for all tool results in a single turn.
Must be >= summarize_threshold. Default: 8000.
summarize_provider: ProviderNameProvider name from [[llm.providers]] for LLM summarization of large results.
Falls back to the primary provider when empty. Default: "".
Implementations§
Source§impl AconConfig
impl AconConfig
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Validate threshold ordering invariants after deserialization.
Returns an error string if passthrough_threshold >= summarize_threshold or
summarize_threshold > total_budget.
§Errors
Returns a descriptive error string when any threshold invariant is violated.
Trait Implementations§
Source§impl Clone for AconConfig
impl Clone for AconConfig
Source§fn clone(&self) -> AconConfig
fn clone(&self) -> AconConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more