From ec0128f9fa08e1f69ca21d10fe2e05616e128e8f Mon Sep 17 00:00:00 2001 From: cfdaily Date: Sun, 17 May 2026 21:16:54 +0800 Subject: [PATCH] auto-sync: 2026-05-17 21:16:54 --- tests/test_router.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_router.py b/tests/test_router.py index a94ae59..7142ed1 100644 --- a/tests/test_router.py +++ b/tests/test_router.py @@ -111,10 +111,8 @@ class TestAgentHandoff: # 不应该走 handoff,应该走 assignee 直派或其他 assert d.mode != "agent_handoff" - def test_handoff_known_but_no_match(self, router): + def test_handoff_known_but_no_match(self): """合法 capability 但无匹配 Agent → 降级""" - # "escalation" 只有 pangtong 有,如果排除 pangton... - # 测试 "data" 有 zhaoyun 但 zhaoyun 不在 profiles 里 router2 = AgentRouter(agent_profiles={ "zhangfei-dev": AgentProfile( agent_id="zhangfei-dev", @@ -122,10 +120,11 @@ class TestAgentHandoff: ), }) d = router2.route(make_task( + assignee=None, # 无 assignee,不会走快速路径 4 current_agent="zhangfei-dev", next_capability="review", # 合法但在 profiles 中无人匹配 )) - # 无 LLM driver → fallback + # 无 LLM driver、无 assignee → fallback 庞统 assert d.agent_id == "pangtong-fujunshi" assert d.mode == "fallback"