mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
refactor(memory): drop on_session_reset — commit-only is enough
OV transparently handles message history across /new and /compress: old messages stay in the same session and extraction is idempotent, so there's no need to rebind providers to a new session_id. The only thing the session boundary actually needs is to trigger extraction. - MemoryProvider / MemoryManager: remove on_session_reset hook - OpenViking: remove on_session_reset override (nothing to do) - AIAgent: replace rotate_memory_session with commit_memory_session (just calls on_session_end, no rebind) - cli.py / run_agent.py: single commit_memory_session call at the session boundary before session_id rotates - tests: replace on_session_reset coverage with routing tests for MemoryManager.on_session_end Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8275fa597a
commit
7cb06e3bb3
6 changed files with 30 additions and 156 deletions
|
|
@ -516,22 +516,6 @@ class OpenVikingMemoryProvider(MemoryProvider):
|
|||
except Exception as e:
|
||||
return tool_error(str(e))
|
||||
|
||||
def on_session_reset(self, new_session_id: str) -> None:
|
||||
"""Rebind per-session state to new_session_id. OV auto-creates the
|
||||
session when the first message is added, so no create call here."""
|
||||
for t in (self._sync_thread, self._prefetch_thread):
|
||||
if t and t.is_alive():
|
||||
t.join(timeout=5.0)
|
||||
|
||||
self._session_id = new_session_id
|
||||
self._turn_count = 0
|
||||
self._prefetch_result = ""
|
||||
self._sync_thread = None
|
||||
self._prefetch_thread = None
|
||||
|
||||
global _last_active_provider
|
||||
_last_active_provider = self
|
||||
|
||||
def shutdown(self) -> None:
|
||||
# Wait for background threads to finish
|
||||
for t in (self._sync_thread, self._prefetch_thread):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue