From 24daf9a51c39ff06bad77996e3e6c9c025be1e36 Mon Sep 17 00:00:00 2001 From: Xubin Ren Date: Thu, 7 May 2026 14:28:02 +0000 Subject: [PATCH] test(memory): accept replay window in consolidation assertion Co-authored-by: Cursor --- tests/agent/test_loop_consolidation_tokens.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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, )