auto-sync: 2026-06-01 22:45:03

This commit is contained in:
cfdaily
2026-06-01 22:45:03 +08:00
parent 9a3d4806b5
commit 8aa8aa1519
+3 -4
View File
@@ -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"""