pub struct CompactionSection {
pub max_context_tokens: Option<usize>,
pub system_prompt_tokens: Option<usize>,
pub compact_at_pct: Option<f64>,
pub compact_budget_threshold_pct: Option<f64>,
pub keep_first_turns: Option<usize>,
pub keep_recent_turns: Option<usize>,
pub max_summary_tokens: Option<usize>,
pub tool_output_max_lines: Option<usize>,
pub focus_message: Option<String>,
pub instances: Vec<CompactionInstanceSection>,
}Expand description
Compaction configuration — unifies context management settings (G5).
Fields§
§max_context_tokens: Option<usize>Maximum context tokens (the model’s context window).
system_prompt_tokens: Option<usize>Tokens reserved for the system prompt.
compact_at_pct: Option<f64>Fraction of max_context_tokens below which headroom is measured.
compact_budget_threshold_pct: Option<f64>Minimum remaining headroom fraction before compaction fires.
keep_first_turns: Option<usize>Turns to keep verbatim from the start.
keep_recent_turns: Option<usize>Minimum turns to keep from the end.
max_summary_tokens: Option<usize>Token budget for the summarised middle section.
tool_output_max_lines: Option<usize>Max lines per tool output in the keep_recent section.
focus_message: Option<String>Focus message to guide compaction summarization.
instances: Vec<CompactionInstanceSection>Named compaction instances with {{...}} ID protocol.
Trait Implementations§
Source§impl Clone for CompactionSection
impl Clone for CompactionSection
Source§fn clone(&self) -> CompactionSection
fn clone(&self) -> CompactionSection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompactionSection
impl Debug for CompactionSection
Source§impl Default for CompactionSection
impl Default for CompactionSection
Source§fn default() -> CompactionSection
fn default() -> CompactionSection
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CompactionSectionwhere
CompactionSection: Default,
impl<'de> Deserialize<'de> for CompactionSectionwhere
CompactionSection: Default,
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CompactionSection
impl RefUnwindSafe for CompactionSection
impl Send for CompactionSection
impl Sync for CompactionSection
impl Unpin for CompactionSection
impl UnsafeUnpin for CompactionSection
impl UnwindSafe for CompactionSection
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
Mutably borrows from an owned value. Read more