v10.13.2 - Consolidation & Hybrid Storage Bug Fixes
This patch release fixes two classes of bugs that caused the memory consolidation system to fail silently or crash when using the Hybrid storage backend.
Fixed
-
HybridMemoryStorage missing StorageProtocol proxy methods (
delete_memory,get_memory_connections,get_access_patterns): Without these methods,DreamInspiredConsolidatorraisedAttributeErrorduring the forgetting phase, silently aborting consolidation when using hybrid storage. Each method now correctly delegates toself.primary(the local SQLite backend). -
Timezone-aware datetime comparison
TypeError: The consolidation module useddatetime.utcfromtimestamp()throughout, which produces naive (timezone-unaware) datetimes. However,get_access_patterns()returns timezone-aware datetimes, causingTypeError: can't compare offset-naive and offset-aware datetimesto crash quarterly and yearly consolidation runs. Fixed across 6 files:consolidation/base.py—_get_memory_age_days()consolidation/clustering.py—_calculate_average_age()consolidation/forgetting.py—current_timecalculation andlast_accessedfallbackconsolidation/decay.py—last_accessedfallbackconsolidation/consolidator.py—filter_memories_by_age,_generate_recommendationsconsolidation/compression.py—_calculate_time_span+ UTC isoformat normalization (.replace('+00:00', 'Z'))
-
Refactored
delete_memory()inHybridMemoryStorage: Now delegates todelete()instead of duplicating sync logic, eliminating a potential divergence between the two code paths. -
Added missing
datetimeimport instorage/hybrid.py: Required for theget_access_patterns()return type annotation.
Credits
Original fixes by @VibeCodeChef (Kemal) via PR #471. Review fixes (naive memory.timestamp normalization in base.py, clustering.py, forgetting.py; delete_memory() refactor; missing datetime import) applied during code review.
Upgrade Notes
No breaking changes. Users of the Hybrid storage backend who run memory consolidation should upgrade to ensure the forgetting phase and quarterly/yearly consolidation runs execute correctly.