supermemory/packages/agent-framework-python/tests
Suhani b2258f0efd fix(agent-framework): report dropped memory injections instead of failing silently
`_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.
2026-08-05 22:16:59 +05:30
..
__init__.py Add Supermemory integration for Microsoft Agent Framework (#775) 2026-03-10 01:49:45 +00:00
test_connection.py Add Supermemory integration for Microsoft Agent Framework (#775) 2026-03-10 01:49:45 +00:00
test_context_provider.py Add Supermemory integration for Microsoft Agent Framework (#775) 2026-03-10 01:49:45 +00:00
test_middleware.py fix(agent-framework): report dropped memory injections instead of failing silently 2026-08-05 22:16:59 +05:30
test_tools.py Add Supermemory integration for Microsoft Agent Framework (#775) 2026-03-10 01:49:45 +00:00
test_utils.py Add Supermemory integration for Microsoft Agent Framework (#775) 2026-03-10 01:49:45 +00:00