hermes-agent/tests/plugins/memory
Adam Biggs b5226caff8 fix(memory): share one SQLite connection per holographic store database
Every MemoryStore instance opened its own SQLite connection guarded by
its own RLock. Several providers coexist in one process (the main agent
plus every delegate_task subagent), so instances pointing at the same
memory_store.db raced as independent WAL writers. Combined with writes
that were not rolled back on error, one connection could leave an open
write transaction that pinned the write lock and made every other
connection's writes fail with "database is locked" for the full busy
timeout.

Instances for the same database now share ONE process-wide connection
and ONE re-entrant lock, so access is fully serialized and
cross-connection contention is impossible. The shared connection is
refcounted: closing one instance never tears it out from under a live
sibling, and the last close releases it. The connection runs in
autocommit (isolation_level=None) so a write that raises mid-method can
never leave a dangling transaction holding the write lock; the existing
explicit commit() calls become harmless no-ops.

The provider's shutdown() now calls the refcount-guarded close() instead
of just dropping the reference: leaving finalization to GC kept the
connection (and its write lock) alive indefinitely on long-running
gateways, prolonging the exact contention this fix removes. The last
provider now releases the connection deterministically while siblings
stay live; regression tests fail without the wiring.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 18:17:40 -07:00
..
__init__.py fix: mem0 API v2 compat, prefetch context fencing, secret redaction (#5423) 2026-04-05 22:43:33 -07:00
test_byterover_provider.py fix(byterover): honor auto extract config 2026-06-27 04:04:15 -07:00
test_hindsight_provider.py fix(hindsight): lazy-install cloud client dependency 2026-06-19 07:36:28 -07:00
test_holographic_retrieval.py fix(memory/holographic): sanitize FTS5 queries for natural-language recall 2026-06-30 15:55:11 -07:00
test_holographic_shutdown_closes_db.py fix(memory/holographic): close DB connection on shutdown instead of leaking to GC (#54133) 2026-06-28 02:41:52 -07:00
test_holographic_store.py fix(memory): share one SQLite connection per holographic store database 2026-07-09 18:17:40 -07:00
test_mem0_backend.py fix(mem0): prune dead get_all, wire rerank config default, warn on MEM0_HOST env override 2026-07-08 01:57:11 +05:30
test_mem0_providers.py feat(mem0): v3 API, OSS mode, update/delete tools, telemetry & review fixes (#15624) 2026-06-22 12:30:47 +00:00
test_mem0_setup.py feat(mem0): add self-hosted mode to the setup wizard 2026-07-07 14:07:16 -07:00
test_mem0_v3.py fix(mem0): prune dead get_all, wire rerank config default, warn on MEM0_HOST env override 2026-07-08 01:57:11 +05:30
test_memory_lazy_install.py fix(memory): lazy-install supermemory + mem0 SDKs like honcho/hindsight 2026-06-29 00:25:36 -07:00
test_openviking_provider.py fix(memory): guard local uploads against credential reads 2026-07-05 03:14:49 -07:00
test_retaindb_provider.py fix(memory): guard local uploads against credential reads 2026-07-05 03:14:49 -07:00
test_supermemory_provider.py fix(memory): lazy-install supermemory + mem0 SDKs like honcho/hindsight 2026-06-29 00:25:36 -07:00