From 66d9983d46c08f40584315a4f08529c9ac99c64f Mon Sep 17 00:00:00 2001 From: aydnOktay Date: Sat, 28 Feb 2026 01:33:41 +0300 Subject: [PATCH] Fix memory tool entry parsing when content contains section sign MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use ENTRY_DELIMITER (\\n§\\n) instead of '§' when splitting entries in _read_file - Prevents incorrect parsing when memory entries contain '§' character - Aligns read logic with write logic for consistency --- tools/memory_tool.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/memory_tool.py b/tools/memory_tool.py index 662bd0a48..2ce763124 100644 --- a/tools/memory_tool.py +++ b/tools/memory_tool.py @@ -345,7 +345,9 @@ class MemoryStore: if not raw.strip(): return [] - entries = [e.strip() for e in raw.split("§")] + # Use ENTRY_DELIMITER for consistency with _write_file. Splitting by "§" + # alone would incorrectly split entries that contain "§" in their content. + entries = [e.strip() for e in raw.split(ENTRY_DELIMITER)] return [e for e in entries if e] @staticmethod