Skip to main content

Module session_memory_utils

Module session_memory_utils 

Source
Expand description

Session memory utility functions — state management, thresholds, config.

Structs§

SessionMemoryConfig
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.