Skip to content

JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.

Python

fix: pass model routing UT and codecheck

FrancesShaw00763ea54f412bd
diff --git a/jiuwenswarm/agents/harness/team/config_loader.py b/jiuwenswarm/agents/harness/team/config_loader.py
index b288675d0b..8f8a700526 100644
--- a/jiuwenswarm/agents/harness/team/config_loader.py
+++ b/jiuwenswarm/agents/harness/team/config_loader.py
@@ -497,7 +497,13 @@ def _build_agents_config(
agent_config = {}
else:
agent_config = dict(raw_agent_config) if isinstance(raw_agent_config, dict) else {}
- if (requested_model_name and requested_model_name.strip()) or (requested_model_ref and requested_model_ref.strip()):
+ has_requested_model = bool(
+ requested_model_name and requested_model_name.strip()
+ )
+ has_requested_model_ref = bool(
+ requested_model_ref and requested_model_ref.strip()
+ )
+ if has_requested_model or has_requested_model_ref:
agent_config["model"] = deepcopy(default_model)
else:
referenced_model = _resolve_agent_model_reference(agent_config.get("model"), config_base)
diff --git a/tests/unit_tests/agentserver/test_subagent_model_tier.py b/tests/unit_tests/agentserver/test_subagent_model_tier.py
index 62aa6ee364..6eec936e13 100644
--- a/tests/unit_tests/agentserver/test_subagent_model_tier.py
+++ b/tests/unit_tests/agentserver/test_subagent_model_tier.py
@@ -33,6 +33,7 @@ def _adapter_with_tier_models() -> JiuWenSwarmDeepAdapter:
adapter = object.__new__(JiuWenSwarmDeepAdapter)
adapter._model_cache = {}
adapter._model_name_to_keys = {}
+ adapter._model_identity_to_keys = {}
adapter._tier_model_cache = {}
adapter._model = None
adapter._instance = None