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:
- Waits for any in-flight sync thread
- Commits the old session if it has pending turns
- Updates
_session_id to the new session
- Resets
_turn_count and clears stale prefetch cache
Description:
plugins/memory/openviking/__init__.pyimplementson_session_end()but does not overrideon_session_switch(), whose base class default is a no-op.When the agent rotates its
session_id(via/new,/branch, context compression),_session_idinside the provider stays at the original value. All subsequentsync_turn()writes land in the already-committed old session, andon_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 betweenon_session_end()andon_memory_write()that:_session_idto the new session_turn_countand clears stale prefetch cache