diff --git a/gateway/run.py b/gateway/run.py index 731bc8c03..82cb10b4e 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -3244,7 +3244,7 @@ class GatewayRunner: old_entry = self.session_store._entries.get(session_key) if old_entry: _flush_task = asyncio.create_task( - self._async_flush_memories(old_entry.session_id, session_key) + self._async_flush_memories(old_entry.session_id) ) self._background_tasks.add(_flush_task) _flush_task.add_done_callback(self._background_tasks.discard) @@ -4990,7 +4990,7 @@ class GatewayRunner: # Flush memories for current session before switching try: _flush_task = asyncio.create_task( - self._async_flush_memories(current_entry.session_id, session_key) + self._async_flush_memories(current_entry.session_id) ) self._background_tasks.add(_flush_task) _flush_task.add_done_callback(self._background_tasks.discard) diff --git a/tests/gateway/test_resume_command.py b/tests/gateway/test_resume_command.py index 739bc149b..dc788f74f 100644 --- a/tests/gateway/test_resume_command.py +++ b/tests/gateway/test_resume_command.py @@ -201,8 +201,8 @@ class TestHandleResumeCommand: db.close() @pytest.mark.asyncio - async def test_resume_flushes_memories_with_gateway_session_key(self, tmp_path): - """Resume should preserve the gateway session key for Honcho flushes.""" + async def test_resume_flushes_memories(self, tmp_path): + """Resume should flush memories from the current session before switching.""" from hermes_state import SessionDB db = SessionDB(db_path=tmp_path / "state.db") @@ -221,6 +221,5 @@ class TestHandleResumeCommand: runner._async_flush_memories.assert_called_once_with( "current_session_001", - _session_key_for_event(event), ) db.close()