Skip to content

Fix memory tool entry parsing when content contains section sign#162

Merged
teknium1 merged 1 commit intoNousResearch:mainfrom
aydnOktay:fix/memory-tool-entry-delimiter-parsing
Feb 28, 2026
Merged

Fix memory tool entry parsing when content contains section sign#162
teknium1 merged 1 commit intoNousResearch:mainfrom
aydnOktay:fix/memory-tool-entry-delimiter-parsing

Conversation

@aydnOktay
Copy link
Copy Markdown
Contributor

This PR fixes a bug in the memory tool's _read_file method where entries were incorrectly split using a single "§" character instead of the ENTRY_DELIMITER ("\n§\n"). When a memory entry contained the section sign character (e.g., "User prefers § for sections"), the parser would wrongly split it into multiple entries. The fix aligns the read logic with the write logic, which uses ENTRY_DELIMITER.join() for consistency. This ensures entries containing "§" in their content are parsed correctly and prevents data corruption when loading MEMORY.md or USER.md files.

- 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
@teknium1 teknium1 merged commit 2b821c3 into NousResearch:main Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants