Complete Tag Parsing Fix
This is a follow-up hotfix to v8.22.1 that completes the tag parsing bug fix across all code paths.
What Was Fixed
The character-split tags bug from v8.22.1 was discovered to exist in 3 additional files beyond documents.py:
-
src/mcp_memory_service/server.py(lines 3345-3354, 3489-3503)- MCP
ingest_documenttool handler - MCP
ingest_directorytool handler
- MCP
-
src/mcp_memory_service/cli/ingestion.py(lines 101-110, 277-291)- CLI
ingest_filecommand - CLI
ingest_directorycommand
- CLI
Root Cause
Same issue as v8.22.1: When tag metadata contained comma-separated strings (e.g., "claude-code-hooks,update-investigation"), using .extend() treated the string as a character iterable, resulting in tags being stored as individual characters.
Database Repairs
- Previous v8.22.1: 13 memories repaired
- This release: 6 additional memories repaired
- Total: 19 memories with corrected tags across both releases
Impact
- MCP tools:
ingest_documentandingest_directorynow correctly parse comma-separated tags - CLI commands:
ingest_fileandingest_directorynow correctly parse comma-separated tags - Comprehensive fix: All 4 files with tag parsing now include
isinstance()type checking
Technical Details
Before (buggy code):
tags.extend(chunk.metadata.get("tags", [])) # Treats "tag1,tag2" as ['t','a','g','1',',',...]After (fixed code):
chunk_tags = chunk.metadata.get("tags", [])
if isinstance(chunk_tags, str):
tags.extend([t.strip() for t in chunk_tags.split(",") if t.strip()])
else:
tags.extend(chunk_tags)Verification
All tag parsing code paths now include type checking to prevent future occurrences of this bug.
Full Changelog: CHANGELOG.md