You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] MemoryManager sync single-memory CRUD silently no-ops against AsyncBaseDb #11143
MemoryManager's sync single-memory CRUD methods silently no-op when the manager is built on an AsyncBaseDb:
add_user_memory / replace_user_memory / delete_user_memory call the async DB APIs without awaiting them — the coroutine is discarded (Python emits RuntimeWarning: coroutine ... was never awaited), nothing is written, and the method still returns a success memory_id.
clear() behaves the same way (returns normally, nothing cleared).
The class contract allows both DB kinds (db: Optional[Union[BaseDb, AsyncBaseDb]]), and the sibling sync methods already guard async DBs with ValueError("... is not supported with an async DB ...") — these four methods are the outliers, so callers get a success result for an operation that never happened.
Repro
fromagno.db.async_sqliteimportAsyncSqliteDbfromagno.memory.managerimportMemoryManagermanager=MemoryManager(db=AsyncSqliteDb(db_file="tmp/test.db"))
memory_id=manager.add_user_memory(memory=UserMemory(memory="likes tea"))
# returns a fresh UUID and emits "RuntimeWarning: coroutine 'AsyncSqliteDb.upsert_user_memory' was never awaited"# nothing is stored
Expected: a clear error (matching the existing "not supported with an async DB" guard convention), not a silent no-op with a success return.
Suggested fix
Add the same isinstance(self.db, AsyncBaseDb) guard the sibling sync methods already use, at the top of add_user_memory, replace_user_memory, delete_user_memory, and clear() — before any mutation or DB call. The async twins remain the supported path.
Tests
Unit tests with an AsyncBaseDb double (and a real AsyncSqliteDb variant): all four methods must raise ValueError matching the existing convention, directly at base (DID NOT RAISE) and the repo's own unit/memory suite grows 75 → 79 with the new tests. Sync BaseDb and db=None behavior is unchanged; there are no in-repo callers of the four sync methods that would regress.
Hi maintainers - I ran into this while using MemoryManager against an async DB and have a fix ready in PR #11154. The triage bot let me know the issue needs the ready label before that PR can be reviewed. Could a maintainer triage this issue and mark it ready when convenient? Happy to adjust the approach if you'd prefer it solved differently.
Activity
kaust1495 commentedon Oct 20, 2026
Hi maintainers - I ran into this while using MemoryManager against an async DB and have a fix ready in PR #11154. The triage bot let me know the issue needs the ready label before that PR can be reviewed. Could a maintainer triage this issue and mark it ready when convenient? Happy to adjust the approach if you'd prefer it solved differently.