hermes - 💡(How to fix) Fix OpenVikingMemoryProvider missing on_session_switch — session ID goes stale after /new

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
RAW_BUFFERClick to expand / collapse

Description:

plugins/memory/openviking/__init__.py implements on_session_end() but does not override on_session_switch(), whose base class default is a no-op.

When the agent rotates its session_id (via /new, /branch, context compression), _session_id inside the provider stays at the original value. All subsequent sync_turn() writes land in the already-committed old session, and on_session_end() tries to commit the same old session again. The new session never accumulates messages, so commit never triggers memory extraction for it.

Other providers like Hindsight already implement this hook correctly — OpenViking just missed it.

Fix approach:

Add an on_session_switch() override between on_session_end() and on_memory_write() that:

  1. Waits for any in-flight sync thread
  2. Commits the old session if it has pending turns
  3. Updates _session_id to the new session
  4. Resets _turn_count and clears stale prefetch cache

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix OpenVikingMemoryProvider missing on_session_switch — session ID goes stale after /new