Skip to main content

Module retention

Module retention 

Source
Expand description

In-memory retention limits for long-running sessions.

The framework’s in-memory stores (InMemoryRunStore, InMemoryTraceSink, InMemorySubagentTaskTracker) accumulate unboundedly by default — fine for short-lived runs, a memory leak for sessions that live for hours or days under cluster workloads.

SessionRetentionLimits lets the host cap each store with a FIFO policy. None for any field keeps the unbounded default, so callers that don’t set anything see no behaviour change.

All caps are soft: when a store hits its cap, the oldest entry is dropped on insert. The framework never returns errors from cap enforcement.

Structs§

SessionRetentionLimits
Per-session in-memory retention caps. Built via SessionOptions::with_retention_limits or by constructing the struct directly.