hermes-agent/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
..
byterover fix(byterover): honor auto extract config 2026-06-27 04:04:15 -07:00
hindsight feat(hindsight): configurable embedded daemon health grace timeout (#50341) 2026-06-21 12:20:53 -07:00
holographic fix(memory): share one SQLite connection per holographic store database 2026-07-09 18:17:40 -07:00
honcho refactor(setup): route dependency installs through the canonical uv→pip→ensurepip ladder 2026-07-07 04:09:35 -07:00
mem0 feat(mem0): add self-hosted mode to the setup wizard 2026-07-07 14:07:16 -07:00
openviking fix(memory): guard local uploads against credential reads 2026-07-05 03:14:49 -07:00
retaindb fix(memory): guard local uploads against credential reads 2026-07-05 03:14:49 -07:00
supermemory fix(memory): lazy-install supermemory + mem0 SDKs like honcho/hindsight 2026-06-29 00:25:36 -07:00
__init__.py fix(memory): register parent packages for user-installed provider imports 2026-06-04 05:35:43 -07:00