pub struct CompactionBlock {
pub keep_first: Option<TurnRange>,
pub keep_recent: Option<CompactedSection>,
pub keep_compacted: Option<CompactedSection>,
pub created_at: DateTime<Utc>,
}Expand description
Non-destructive compaction overlay. Stored on LoopRecord alongside
the original messages. When present, the context loader uses this block
instead of raw messages.
Three sections control what gets loaded into context:
keep_first: turns kept verbatim from the start (most recent loop only)keep_recent: recent turns with truncated tool outputs (most recent loop only)keep_compacted: fully summarised section (all loops)
Fields§
§keep_first: Option<TurnRange>Turns kept verbatim from the start of the loop.
Only populated for the MOST RECENT loop. For older loops this is None.
During context load: original messages in this range are used as-is.
keep_recent: Option<CompactedSection>Recent turns with tool outputs truncated. Rest unchanged.
Only populated for the MOST RECENT loop. For older loops this is None.
Invariant: if a ToolCall is in range, its corresponding ToolResult is too.
keep_compacted: Option<CompactedSection>Fully summarised middle section (most recent loop) or entire loop (older loops). Relevant for ALL loops — this is what gets loaded from earlier loops.
created_at: DateTime<Utc>When this block was created.
Trait Implementations§
Source§impl Clone for CompactionBlock
impl Clone for CompactionBlock
Source§fn clone(&self) -> CompactionBlock
fn clone(&self) -> CompactionBlock
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 CompactionBlock
impl Debug for CompactionBlock
Source§impl<'de> Deserialize<'de> for CompactionBlock
impl<'de> Deserialize<'de> for CompactionBlock
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 PartialEq for CompactionBlock
impl PartialEq for CompactionBlock
Source§fn eq(&self, other: &CompactionBlock) -> bool
fn eq(&self, other: &CompactionBlock) -> bool
self and other values to be equal, and is used by ==.