From cd2c7eb26f96065b41285711514c185203b5f77d Mon Sep 17 00:00:00 2001 From: chengyongru Date: Mon, 30 Mar 2026 17:13:06 +0800 Subject: [PATCH] fix(tests): adapt restart command test to accumulated usage dict The usage dict now includes cached_tokens field, so exact dict equality assertions need to check specific keys instead. --- tests/cli/test_restart_command.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/cli/test_restart_command.py b/tests/cli/test_restart_command.py index 3281afe2d..6efcdad0d 100644 --- a/tests/cli/test_restart_command.py +++ b/tests/cli/test_restart_command.py @@ -152,10 +152,12 @@ class TestRestartCommand: ]) await loop._run_agent_loop([]) - assert loop._last_usage == {"prompt_tokens": 9, "completion_tokens": 4} + assert loop._last_usage["prompt_tokens"] == 9 + assert loop._last_usage["completion_tokens"] == 4 await loop._run_agent_loop([]) - assert loop._last_usage == {"prompt_tokens": 0, "completion_tokens": 0} + assert loop._last_usage["prompt_tokens"] == 0 + assert loop._last_usage["completion_tokens"] == 0 @pytest.mark.asyncio async def test_status_falls_back_to_last_usage_when_context_estimate_missing(self):