mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-08-28 05:25:33 +00:00
`_inject_memories` had two paths that discarded memories without any signal, so a misbehaving context looked identical to one with no memories to inject. The fallback branch only prepended a system message when `context.messages` was a `list`, and silently did nothing otherwise. It also wrapped the insert in `except Exception: pass`, commented "log a warning" but with nothing to log through, since the function had no logger in scope. The function now takes the middleware's logger and warns on both paths: one for a non-list container, including the type it actually got, and one for an insert that raised, including the exception type. Neither raises, since injection is best-effort and must not fail the chat request. `_inject_memories` is private with a single call site, so the logger is a required argument rather than an optional one that could reintroduce the silent path. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_connection.py | ||
| test_context_provider.py | ||
| test_middleware.py | ||
| test_tools.py | ||
| test_utils.py | ||