pub struct SessionRetentionLimits {
pub max_runs_retained: Option<usize>,
pub max_events_per_run: Option<usize>,
pub max_trace_events: Option<usize>,
pub max_terminal_subagent_tasks: Option<usize>,
}Expand description
Per-session in-memory retention caps. Built via
SessionOptions::with_retention_limits
or by constructing the struct directly.
Fields§
§max_runs_retained: Option<usize>Maximum number of runs retained in
InMemoryRunStore.
When a new run is created past this cap, the oldest run
(by insertion order) is dropped along with its events.
None (default) keeps all runs.
max_events_per_run: Option<usize>Maximum number of event records retained per run in
InMemoryRunStore.
When a run accumulates more events than this, the oldest
events are FIFO-dropped. The run snapshot’s event_count
is not decremented — it remains the total ever recorded.
None (default) keeps all events.
max_trace_events: Option<usize>Maximum number of events retained in
InMemoryTraceSink.
When the sink reaches this cap, the oldest event is dropped
on each new write. None (default) keeps all events.
max_terminal_subagent_tasks: Option<usize>Maximum number of terminal (Completed / Failed / Cancelled)
subagent task snapshots retained in
InMemorySubagentTaskTracker.
Running tasks are never dropped.
When the count of terminal entries exceeds this cap, the
oldest terminal entry (by completion time) is dropped.
None (default) keeps all terminal entries.
Implementations§
Source§impl SessionRetentionLimits
impl SessionRetentionLimits
pub fn with_max_runs(self, n: usize) -> Self
pub fn with_max_events_per_run(self, n: usize) -> Self
pub fn with_max_trace_events(self, n: usize) -> Self
pub fn with_max_terminal_subagent_tasks(self, n: usize) -> Self
Trait Implementations§
Source§impl Clone for SessionRetentionLimits
impl Clone for SessionRetentionLimits
Source§fn clone(&self) -> SessionRetentionLimits
fn clone(&self) -> SessionRetentionLimits
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 SessionRetentionLimits
impl Debug for SessionRetentionLimits
Source§impl Default for SessionRetentionLimits
impl Default for SessionRetentionLimits
Source§fn default() -> SessionRetentionLimits
fn default() -> SessionRetentionLimits
impl Copy for SessionRetentionLimits
Auto Trait Implementations§
impl Freeze for SessionRetentionLimits
impl RefUnwindSafe for SessionRetentionLimits
impl Send for SessionRetentionLimits
impl Sync for SessionRetentionLimits
impl Unpin for SessionRetentionLimits
impl UnsafeUnpin for SessionRetentionLimits
impl UnwindSafe for SessionRetentionLimits
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more