Agent Zero AI framework
Tighten optional Vision Model configuration
Alessandro8d1c76e654d0
diff --git a/plugins/_model_config/helpers/model_config.py b/plugins/_model_config/helpers/model_config.pyindex 003d7be7d..0c6f539c2 100644--- a/plugins/_model_config/helpers/model_config.py+++ b/plugins/_model_config/helpers/model_config.py@@ -277,9 +277,6 @@ def _clean_preset_for_file(preset: dict) -> dict:slot_config = preset.get(slot)if isinstance(slot_config, dict):slot_clean = _strip_ui_fields(slot_config, strip_api_key=True)- if slot == "vision" and _slot_has_identity(slot_clean):- slot_clean["vision"] = True- slot_clean.setdefault("max_embeds", 10)cleaned[slot] = (slot_cleanif name == DEFAULT_PRESET_NAME@@ -762,7 +759,9 @@ def get_vision_model_config(agent=None) -> dict:"""Get the active Vision Model config after applying Main-first routing."""cfg = get_effective_config(agent)vision_cfg = cfg.get("vision_model", {})- if not _slot_has_identity(vision_cfg):+ if not all(+ str(vision_cfg.get(key) or "").strip() for key in ("provider", "name")+ ):return {}chat_cfg = cfg.get("chat_model", {})return (diff --git a/tests/test_vision_load_image_refs.py b/tests/test_vision_load_image_refs.pyindex 6213335b1..01b931a08 100644--- a/tests/test_vision_load_image_refs.py+++ b/tests/test_vision_load_image_refs.py@@ -143,6 +143,8 @@ def test_active_vision_model_route_prefers_main_native_vision(monkeypatch):cases = [({"vision": False}, {}, False),+ ({"vision": False}, {"provider": "p"}, False),+ ({"vision": False}, {"name": "v"}, False),({"vision": True}, {"provider": "p", "name": "v"}, False),({"vision": False}, {"provider": "p", "name": "v"}, True),(