mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-10-02 02:11:20 +00:00
_enhance_context_with_memories refreshes the system message by calling MEMORY_TAG_PATTERN.sub(tagged_memory, existing_content). Passing the memory text as a string replacement makes re.sub parse it as a template, so backslash sequences in ordinary memories are expanded rather than inserted. Two failures follow, both on the second and later turns, once a block exists to replace: "User's repo is at C:\Users\alice" -> re.error: bad escape \U "User writes \1 for a capture group" -> re.error: invalid group reference 1 The exception propagates out of context enhancement and aborts the turn. A callable replacement inserts the text verbatim and cannot be parsed as a template. Adds a regression test covering the Windows-path case, which fails on main with the production error. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_empty_profile.py | ||