Expand description
Session memory utility functions — state management, thresholds, config.
Structs§
- Session
Memory Config - Configuration for session memory extraction thresholds
Constants§
- DEFAULT_
SESSION_ MEMORY_ CONFIG - Default configuration for session memory (backward compat constant)
Functions§
- get_
extraction_ stale_ threshold - Get the extraction stale threshold
- get_
extraction_ wait_ timeout - Get the extraction wait timeout
- get_
last_ summarized_ message_ id - Get the message ID up to which the session memory is current
- get_
session_ memory_ config - Get the current session memory configuration
- get_
session_ memory_ path - Get the session memory file path
- get_
tool_ calls_ between_ updates - Get the configured number of tool calls between updates
- has_
met_ initialization_ threshold - Check if we’ve met the threshold to initialize session memory. Uses total context window tokens (same as autocompact) for consistent behavior.
- has_
met_ update_ threshold - Check if we’ve met the threshold for the next update. Measures actual context window growth since last extraction.
- is_
session_ memory_ initialized - Check if session memory has been initialized (met minimumTokensToInit threshold)
- mark_
extraction_ completed - Mark extraction as completed (called from session_memory.rs)
- mark_
extraction_ started - Mark extraction as started (called from session_memory.rs)
- mark_
session_ memory_ initialized - Mark session memory as initialized
- record_
extraction_ token_ count - Record the context size at the time of extraction. Used to measure context growth for minimumTokensBetweenUpdate threshold.
- reset_
session_ memory_ state - Reset session memory state (useful for testing)
- set_
last_ summarized_ message_ id - Set the last summarized message ID (called from session_memory.rs)
- set_
session_ memory_ config - Set the session memory configuration
- set_
session_ memory_ path - Set the session memory file path (called during file setup)
- wait_
for_ session_ memory_ extraction - Wait for any in-progress session memory extraction to complete (with timeout). Returns immediately if no extraction is in progress or if extraction is stale.