From 8aa8aa151909250987bb67b1ef9d6c32a9209acf Mon Sep 17 00:00:00 2001 From: cfdaily Date: Mon, 1 Jun 2026 22:45:03 +0800 Subject: [PATCH] auto-sync: 2026-06-01 22:45:03 --- tests/test_dispatcher.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_dispatcher.py b/tests/test_dispatcher.py index a84c56c..f6434da 100644 --- a/tests/test_dispatcher.py +++ b/tests/test_dispatcher.py @@ -260,7 +260,7 @@ class TestDispatcherErrorClassification: """E14.3: Dispatcher 捕获 AgentBusyError → 日志记录具体原因 → 路由决策""" def test_busy_error_reason_in_result(self, dispatcher, task_pending): - """AgentBusyError 被捕获后,结果包含具体 busy 原因""" + """AgentBusyError 被捕获后,结果包含具体 busy 原因(status=skipped)""" mock_spawner = MagicMock() mock_spawner.spawn_full_agent = AsyncMock( side_effect=AgentBusyError("zhangfei-dev", reason="session_locked", @@ -269,9 +269,8 @@ class TestDispatcherErrorClassification: dispatcher.spawner = mock_spawner result = asyncio.run(dispatcher.dispatch(task_pending)) - assert result["status"] == "error" - # AgentBusyError 应被 dispatcher 捕获并包含在结果中 - assert "busy" in result.get("reason", "").lower() or "locked" in result.get("reason", "").lower() or "error" in result.get("status", "") + assert result["status"] == "skipped" + assert "session" in result.get("reason", "").lower() or "locked" in result.get("reason", "").lower() def test_counter_busy_returns_skipped(self, dispatcher, task_pending): """counter_blocked → skipped(非 error)"""