mirror of
https://github.com/nesquena/hermes-webui.git
synced 2026-05-26 03:30:36 +00:00
65e5690772
The agent cache stores full AIAgent instances (each holding complete conversation history) without size limit. Long-running servers with many sessions can accumulate unbounded memory usage. Changes: - Replace dict with OrderedDict for LRU tracking - Add SESSION_AGENT_CACHE_MAX = 50 limit - Evict least-recently-used entries when cache exceeds limit - Call move_to_end() on cache hits to maintain LRU order This prevents memory exhaustion on servers with many active sessions.