mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-30 01:41:43 +00:00
Previously, when a session expired (idle/daily reset), the memory flush ran synchronously inside get_or_create_session — blocking the user's message for 10-60s while an LLM call saved memories. Now a background watcher task (_session_expiry_watcher) runs every 5 min, detects expired sessions, and flushes memories proactively in a thread pool. By the time the user sends their next message, memories are already saved and the response is immediate. Changes: - Add _is_session_expired(entry) to SessionStore — works from entry alone without needing a SessionSource - Add _pre_flushed_sessions set to track already-flushed sessions - Remove sync _on_auto_reset callback from get_or_create_session - Refactor flush into _flush_memories_for_session (sync worker) + _async_flush_memories (thread pool wrapper) - Add _session_expiry_watcher background task, started in start() - Simplify /reset command to use shared fire-and-forget flush - Add 10 tests for expiry detection, callback removal, tracking |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_async_memory_flush.py | ||
| test_channel_directory.py | ||
| test_config.py | ||
| test_delivery.py | ||
| test_document_cache.py | ||
| test_homeassistant.py | ||
| test_hooks.py | ||
| test_media_extraction.py | ||
| test_mirror.py | ||
| test_pairing.py | ||
| test_platform_base.py | ||
| test_session.py | ||
| test_sticker_cache.py | ||
| test_telegram_documents.py | ||
| test_telegram_format.py | ||
| test_transcript_offset.py | ||
| test_update_command.py | ||
| test_whatsapp_connect.py | ||