From 143efd6531fa47d6c90d957edf6ea4b4acc4cbcf Mon Sep 17 00:00:00 2001 From: q Date: Sat, 18 Apr 2026 17:02:11 +0300 Subject: [PATCH] Filter is_system and is_hidden messages in chunking (align with Lotus reference) Lotus explicitly filters both flags before building chunks. Our _clean_all was only filtering by is_empty, so system/hidden messages with content (e.g. member_event) were included in chunks and polluted the index. Co-Authored-By: Claude Sonnet 4.6 --- index/chunking.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index/chunking.py b/index/chunking.py index 60cbdfc..9b7ee4f 100644 --- a/index/chunking.py +++ b/index/chunking.py @@ -11,7 +11,7 @@ OVERLAP_MESSAGES = 2 def _clean_all(messages: list[Message]) -> list[CleanedMessage]: - cleaned = [clean_message(m) for m in messages] + cleaned = [clean_message(m) for m in messages if not m.is_system and not m.is_hidden] return [c for c in cleaned if not c.is_empty]