mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
`_inject_memories` did not work against Agent Framework `Message` objects, in two separate ways. 1. `Message.text` is a read-only property derived from `Message.contents`, so assigning to it raises `AttributeError`. Every request that found an existing system message hit this path, and `_inject_memories` is called from `process()` without a guard, so the exception propagated and failed the whole chat call. Memories are now appended as an extra text content item, and the dict branch is checked first so plain-dict messages keep working. 2. When no system message was present, the prepended message carried the raw memories instead of the `wrap_memory_injection` output. That is the fence which marks retrieved memories as data and tells the model not to follow instructions inside them, so untrusted memory content reached the model unfenced. This path is common, since it covers any agent built without instructions. Both branches now inject the same wrapped text. Adds coverage for `_inject_memories`, which previously had none. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_connection.py | ||
| test_context_provider.py | ||
| test_middleware.py | ||
| test_tools.py | ||
| test_utils.py | ||