pub struct SessionPruneConfig {
pub keep_recent_n: usize,
pub pruned_tool_result_max_bytes: usize,
pub preserve_task: bool,
}Expand description
Configuration for session-level pruning of old tool results.
Before each LLM call, old tool results are truncated in-place to reduce token usage. Recent messages are preserved at full fidelity.
Fields§
§keep_recent_n: usizeNumber of recent user/assistant message pairs to keep at full fidelity. Default: 2.
pruned_tool_result_max_bytes: usizeMaximum bytes for a pruned tool result. Content exceeding this is
replaced with head + tail + [pruned: N bytes]. Default: 200.
preserve_task: boolWhether to preserve the first user message (task) from pruning. Default: true.
Trait Implementations§
Source§impl Clone for SessionPruneConfig
impl Clone for SessionPruneConfig
Source§fn clone(&self) -> SessionPruneConfig
fn clone(&self) -> SessionPruneConfig
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 SessionPruneConfig
impl Debug for SessionPruneConfig
Auto Trait Implementations§
impl Freeze for SessionPruneConfig
impl RefUnwindSafe for SessionPruneConfig
impl Send for SessionPruneConfig
impl Sync for SessionPruneConfig
impl Unpin for SessionPruneConfig
impl UnsafeUnpin for SessionPruneConfig
impl UnwindSafe for SessionPruneConfig
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