hermes-agent/tests/plugins/memory
harshitAgr 91e9459e10 fix(openviking): track writers per-session so commit waits for all
sync_turn's bounded join could drop a still-alive previous worker by
replacing the single _sync_thread slot. The dropped worker kept POSTing
under the old sid but was no longer visible to on_session_end /
on_session_switch, so the commit could fire while orphaned writes were
still in flight — those writes landed past the commit boundary and were
never extracted.

Replace the single _sync_thread slot with _inflight_writers:
Dict[sid, Set[Thread]]. Writers self-register on spawn (sync_turn,
on_memory_write) and self-deregister on exit. The commit path drains
_drain_writers(sid, 10.0) and skips the commit if any writer for that
sid is still alive after the bounded budget.

Also trim inline review-rationale comments to short invariants per
reviewer style ask: "commit only after session writes drain" and
"drop prefetch results from older switch generations."

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
(cherry picked from commit 7537ee6f5b)
2026-06-17 12:55:37 +08:00
..
__init__.py fix: mem0 API v2 compat, prefetch context fencing, secret redaction (#5423) 2026-04-05 22:43:33 -07:00
test_hindsight_provider.py feat(hindsight): make observation scopes configurable on retain 2026-06-15 04:59:17 -07:00
test_mem0_v2.py fix(honcho): harden self-hosted setup paths 2026-05-29 22:29:48 -07:00
test_openviking_provider.py fix(openviking): track writers per-session so commit waits for all 2026-06-17 12:55:37 +08:00
test_supermemory_provider.py refactor(supermemory): session-level ingest + kebab aliases (salvaged from #32487) (#38756) 2026-06-04 11:50:02 +05:30