From 05435e7faddfe4bec2ed7051ff27f11efbf99454 Mon Sep 17 00:00:00 2001 From: Apple Date: Wed, 18 Feb 2026 10:28:53 -0800 Subject: [PATCH] router: bypass local routing rules for cloud-first agents --- services/router/main.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/services/router/main.py b/services/router/main.py index a1af1c82..b95b1f7c 100644 --- a/services/router/main.py +++ b/services/router/main.py @@ -1463,6 +1463,12 @@ async def agent_infer(agent_id: str, request: InferRequest): default_llm = "cloud_deepseek" routing_rules = router_config.get("routing", []) + if agent_id.lower() in _CLOUD_FIRST_AGENT_SET and not (metadata or {}).get("force_local_model"): + # For cloud-first agents, ignore local-only routing rules unless explicitly forced. + routing_rules = [ + rule for rule in routing_rules + if not (isinstance(rule.get("use_llm"), str) and not rule.get("use_llm", "").startswith("cloud_")) + ] default_llm = _select_default_llm(agent_id, metadata, default_llm, routing_rules) # Get LLM profile configuration