test(ai-router): 修正 test_query_routes_to_ollama 斷言
Some checks failed
CD Pipeline / build-and-deploy (push) Failing after 41s

Phase 25 P0 後 DIAGNOSE 走 _local_fallback_chain [NEMOTRON, OLLAMA]
選 NEMOTRON 為 primary,fallback 只剩 OLLAMA 一個,
>= 2 斷言過嚴,改為 >= 1。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-04 18:02:43 +08:00
parent c4923b6908
commit 428ed5f8cd

View File

@@ -157,14 +157,16 @@ class TestAIRouter:
"""測試 AI 路由器"""
def test_query_routes_to_ollama(self):
"""測試查詢路由到 Ollama"""
"""測試查詢路由到 NemotronPhase 25 P0: DIAGNOSE 升級至 Nemotron"""
router = AIRouter()
decision = router.route_sync("查詢 Pod 狀態", {})
# DIAGNOSE 意圖 → Ollama
# DIAGNOSE 意圖 → Nemotron (P0 升級)
assert decision.intent == IntentType.DIAGNOSE
assert decision.model is not None
assert len(decision.fallback_models) >= 2
# DIAGNOSE 使用 _local_fallback_chain [NEMOTRON, OLLAMA]
# 選了 NEMOTRON 後fallback 只剩 OLLAMA 一個 — 此為正確的隱私邊界設計
assert len(decision.fallback_models) >= 1
def test_alert_intent_classification(self):
"""測試告警意圖分類"""