pub struct CompactionRuntime {Show 14 fields
pub enabled: bool,
pub compact_at_tokens: u32,
pub tail_keep_chars: usize,
pub tool_result_max_chars: usize,
pub micro_threshold_bytes: usize,
pub micro_summary_max_chars: usize,
pub micro_model: String,
pub lock_ttl_seconds: u32,
pub summarizer_model: String,
pub auto_token_pct: f32,
pub auto_max_age_minutes: u64,
pub auto_buffer_tokens: u64,
pub auto_min_turns_between: u32,
pub auto_max_consecutive_failures: u32,
}Expand description
Flattened compaction config that the agent loop reads on
every turn. Lives alongside the behavior so a hot-reload can swap
the whole struct via Arc::make_mut.
Fields§
§enabled: bool§compact_at_tokens: u32Trigger threshold in tokens. When the pre-flight estimate crosses this, run compaction before the request.
tail_keep_chars: usizeMinimum tail to preserve verbatim, in chars (≈4 chars/token).
find_safe_boundary walks from the end until reaching this.
tool_result_max_chars: usizePer-tool-result hard cap, in chars. Above this, the body is
replaced by a [truncated NNN bytes] marker pre-send.
micro_threshold_bytes: usizeMicrocompact threshold. Tool results above this byte size are summarized before sending the next LLM request.
micro_summary_max_chars: usizeMaximum summary body retained for one microcompacted tool result.
micro_model: StringOptional model override for microcompact. Empty = current turn model.
lock_ttl_seconds: u32Lock TTL for CompactionStore::try_acquire_lock. Above this
after a crash, the next acquire wins automatically.
summarizer_model: StringOverride of the summary model. Empty = reuse the agent’s main model.
auto_token_pct: f32Token-pct trigger (0.0 disables token trigger).
auto_max_age_minutes: u64Age trigger in minutes (0 disables age trigger).
auto_buffer_tokens: u64Safety margin below effective context window.
auto_min_turns_between: u32Minimum turns between consecutive auto-compactions.
auto_max_consecutive_failures: u32Consecutive failures that trip the circuit breaker.
Trait Implementations§
Source§impl Clone for CompactionRuntime
impl Clone for CompactionRuntime
Source§fn clone(&self) -> CompactionRuntime
fn clone(&self) -> CompactionRuntime
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompactionRuntime
impl Debug for CompactionRuntime
Auto Trait Implementations§
impl Freeze for CompactionRuntime
impl RefUnwindSafe for CompactionRuntime
impl Send for CompactionRuntime
impl Sync for CompactionRuntime
impl Unpin for CompactionRuntime
impl UnsafeUnpin for CompactionRuntime
impl UnwindSafe for CompactionRuntime
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 more