Skip to content

Your lightweight open-source personal agent.

test(memory): accept replay window in consolidation assertion

Xubin Ren24daf9a51c39
diff --git a/tests/agent/test_loop_consolidation_tokens.py b/tests/agent/test_loop_consolidation_tokens.py
index 347cab1e9..aeb67d8b3 100644
--- a/tests/agent/test_loop_consolidation_tokens.py
+++ b/tests/agent/test_loop_consolidation_tokens.py
@@ -2,8 +2,8 @@ from unittest.mock import AsyncMock, MagicMock
import pytest
-from nanobot.agent.loop import AgentLoop
import nanobot.agent.memory as memory_module
+from nanobot.agent.loop import AgentLoop
from nanobot.bus.queue import MessageBus
from nanobot.providers.base import LLMResponse
@@ -205,9 +205,10 @@ async def test_preflight_consolidation_receives_pending_summary(tmp_path) -> Non
await loop.process_direct("hello", session_key="cli:test")
- loop.consolidator.maybe_consolidate_by_tokens.assert_awaited_once_with(
+ loop.consolidator.maybe_consolidate_by_tokens.assert_any_await(
session,
session_summary="Previous conversation summary: earlier context",
+ replay_max_messages=loop._max_messages,
)