fix(insights): handle None memory_type and tags in InsightGenerator sort
Fixed
- InsightGenerator TypeError (
src/mcp_memory_service/consolidation/insights.py): FixedTypeError: '<' not supported between instances of 'str' and 'NoneType'crash when memories haveNonevalues formemory_typeortagsfields.dict.get(key, default)does not fall back to the default when the key is present with aNonevalue; fixed withor ""/or []idiom. Step 6 (Insight Cards) in themaintaincycle now runs without errors — 201 insights generated, 106 stored, no errors in testing.
Root Cause
Three sort operations in InsightGenerator used dict.get("key", default) which only applies the fallback when the key is absent, not when it is present with a None value. All three lines were updated to use the or default idiom:
tags = sorted(set(mem.get("tags", [])))→ filters outNoneentries via generator expressionrecent_types = set(m.get("memory_type", "") ...)→or ""fallbackold_types = set(m.get("memory_type", "") ...)→or ""fallback
Upgrade
pip install --upgrade mcp-memory-serviceFull changelog: https://github.com/doobidoo/mcp-memory-service/blob/main/CHANGELOG.md#10552---2026-05-12