fix(ai-router): fallback_models 排除 selected_model 避免重複
All checks were successful
CD Pipeline / build-and-deploy (push) Successful in 6m58s

DIAGNOSE intent 路由至 Nemotron 後,fallback_chain 中的 OPENCLAW_NEMO
也使用相同 model string,導致 fallback_models 包含已選模型。

修正: 過濾掉與 selected_model 相同的 model string。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
OG T
2026-04-04 17:43:44 +08:00
parent 0c180dec86
commit c4eafd2a5b

View File

@@ -163,7 +163,7 @@ class RoutingDecision:
# 向後相容
self.model = self.selected_model
self.reason = self.routing_reason
self.fallback_models = [model for _, model in self.fallback_chain]
self.fallback_models = [model for _, model in self.fallback_chain if model != self.selected_model]
def to_dict(self) -> dict:
"""轉換為字典 (API 回應用)"""