Skip to content

Commit 3e3bf2b

Browse files
committed
fix: preserve memory delimiter characters
1 parent e5b843c commit 3e3bf2b

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

tests/tools/test_memory_tool.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,14 @@ class TestEdgeCases:
458458
"""Test edge cases and boundary conditions."""
459459

460460
def test_entry_with_delimiter_char(self, store):
461-
"""Entry containing § character is handled correctly."""
462-
# The § is the delimiter, but it's stripped in entries
463-
store.add("memory", "entry with § symbol")
464-
assert len(store.memory_entries) == 1
461+
"""Entry containing § character round-trips through disk correctly."""
462+
content = "entry with § symbol"
463+
464+
store.add("memory", content)
465+
466+
reloaded = MemoryStore(memory_char_limit=500, user_char_limit=300)
467+
reloaded.load_from_disk()
468+
assert reloaded.memory_entries == [content]
465469

466470
def test_multiline_entry(self, store):
467471
"""Multiline entries are preserved."""

tools/memory_tool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def _read_file(path: Path) -> List[str]:
345345
if not raw.strip():
346346
return []
347347

348-
entries = [e.strip() for e in raw.split("§")]
348+
entries = [e.strip() for e in raw.split(ENTRY_DELIMITER)]
349349
return [e for e in entries if e]
350350

351351
@staticmethod

0 commit comments

Comments
 (0)