pub struct CompactionPolicy {
pub strategy: Arc<dyn CompactionStrategy>,
pub model_client: Arc<dyn ModelClient>,
pub context_window_tokens: u64,
}Expand description
Optional compaction wiring: strategy + the model client used to run
the summarize request + the resolved context-window cap. All three
must travel together; without any of them the loop can’t make a
useful compaction decision. AgentLoopHarness::with_compaction
installs it once and the per-turn loop checks it between steps.
Fields§
§strategy: Arc<dyn CompactionStrategy>§model_client: Arc<dyn ModelClient>Model client used by strategy.compact to run the summarize
request. Usually the same provider as the main turn model so the
Anthropic cache prefix stays hot; tests may swap in a fake.
context_window_tokens: u64Trait Implementations§
Source§impl Clone for CompactionPolicy
impl Clone for CompactionPolicy
Source§fn clone(&self) -> CompactionPolicy
fn clone(&self) -> CompactionPolicy
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 moreAuto Trait Implementations§
impl !RefUnwindSafe for CompactionPolicy
impl !UnwindSafe for CompactionPolicy
impl Freeze for CompactionPolicy
impl Send for CompactionPolicy
impl Sync for CompactionPolicy
impl Unpin for CompactionPolicy
impl UnsafeUnpin for CompactionPolicy
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