supermemory/packages/pipecat-sdk-python/tests
Agnik47 8e11c1f786 fix(pipecat): keep memory text literal when replacing the injected block
_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.
2026-09-04 04:21:21 +05:30
..
__init__.py pipecat-sdk (#663) 2026-01-10 15:19:31 -08:00
test_empty_profile.py fix(pipecat): keep memory text literal when replacing the injected block 2026-09-04 04:21:21 +05:30