pub struct HeadDropCompactor;Expand description
Reference compactor: drop oldest turns until the rendered
character count fits under budget_chars. Tool round-trips
stay paired by construction; the strategy never partially
includes a turn.
Synchronous in spirit — the async fn body runs to completion
without awaiting any future. Operators that want LLM-generated
summary compaction reach for entelix_agents::SummaryCompactor
instead.
Trait Implementations§
Source§impl Clone for HeadDropCompactor
impl Clone for HeadDropCompactor
Source§fn clone(&self) -> HeadDropCompactor
fn clone(&self) -> HeadDropCompactor
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 Compactor for HeadDropCompactor
impl Compactor for HeadDropCompactor
Source§fn compact<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
events: &'life1 [GraphEvent],
budget_chars: usize,
_ctx: &'life2 ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<CompactedHistory>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn compact<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
events: &'life1 [GraphEvent],
budget_chars: usize,
_ctx: &'life2 ExecutionContext,
) -> Pin<Box<dyn Future<Output = Result<CompactedHistory>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Compact
events to fit within budget_chars. The budget is
approximate — implementations measure character length of
the rendered text (closest free proxy for token count
without pulling a tokenizer dependency). The
ExecutionContext carries cancellation + deadline so a
long-running summarisation respects the same lifetime as the
dispatch that triggered it. Returns Error::Config when
the event log violates the pair invariant before
compaction (e.g. ToolResult without a preceding
ToolCall); a well-formed SessionGraph never hits this
path.Source§impl Debug for HeadDropCompactor
impl Debug for HeadDropCompactor
Source§impl Default for HeadDropCompactor
impl Default for HeadDropCompactor
Source§fn default() -> HeadDropCompactor
fn default() -> HeadDropCompactor
Returns the “default value” for a type. Read more
impl Copy for HeadDropCompactor
Auto Trait Implementations§
impl Freeze for HeadDropCompactor
impl RefUnwindSafe for HeadDropCompactor
impl Send for HeadDropCompactor
impl Sync for HeadDropCompactor
impl Unpin for HeadDropCompactor
impl UnsafeUnpin for HeadDropCompactor
impl UnwindSafe for HeadDropCompactor
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