{"repo":"NousResearch/hermes-agent","public_id":"29135","display_label":"Native vision priority over auxiliary fallback routing","summary":"These issues and pull requests concern the logic for preferring native model vision capabilities over configured auxiliary vision overrides in auto image-routing mode. Multiple fixes and features address cases where auxiliary.vision configuration incorrectly blocked or bypassed native vision support.","subsystem":"agent","kind":"bug","counts":{"members":10,"open_issues":1,"open_issues_distinct":1,"open_prs":1,"closed_issues":2,"merged_prs":1,"attempt_prs":6},"landed_fix":{"status":"merged_to_main","basis":"structural","pr":57650,"merged_at":"2026-07-03T10:43:35+00:00"},"resolution":{"state":"partially_resolved","by":"pr-57650"},"freshness":{"state":"verified","last_verified_at":"2026-07-03T10:43:35+00:00","is_stale":false},"grouping":{"backbone":"STRUCTURAL_PARTIAL","link_density":0.20177777777777778},"fix_edges":[{"issue_number":29135,"pr_number":57650,"tier":"verified","basis":"closing_ref","confidence":0.95,"recoverable_from_timeline":true,"pr_merged_at":"2026-07-03T10:43:35+00:00"}],"members":[{"kind":"issue","number":29135,"title":"Image auto-routing cannot use native vision when auxiliary.vision is configured as fallback","url":null,"state":"closed"},{"kind":"issue","number":44299,"title":"auxiliary.vision explicit config blocks native vision + need image-in-user-message injection for providers like Xiaomi MiMo","url":null,"state":"open"},{"kind":"issue","number":48964,"title":"Feature: native vision fast path should be tried before explicit aux vision override","url":null,"state":"closed"},{"kind":"pr","number":29138,"title":"fix: prefer native vision in auto image routing","url":null,"state":"closed","close_reason":{"category":"uncategorized","implication":"needs_llm"},"merged":false},{"kind":"pr","number":32519,"title":"fix(agent): prefer native vision over auxiliary fallback in auto mode (#29135)","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#57650","number":57650}],"category":"merged_via","implication":"superseded"},"merged":false},{"kind":"pr","number":44320,"title":"fix(image-routing): check native vision support before aux override","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#44305","number":44305}],"category":"superseded_by_pr","implication":"superseded"},"merged":false,"is_fix_pr":true,"fix_tier":"suggested","fix_detail_withheld":true},{"kind":"pr","number":44450,"title":"fix(agent): prefer native vision when main model supports it (#44299)","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#32519","number":32519},{"kind":"pr","value":"#44299","number":44299}],"category":"superseded_by_pr","implication":"superseded"},"merged":false,"is_fix_pr":true,"fix_tier":"suggested","fix_detail_withheld":true},{"kind":"pr","number":45571,"title":"fix(vision_tools): check supports_vision_tool_messages in native fast path (#44299)","url":null,"state":"closed","close_reason":{"refs":[{"kind":"pr","value":"#39692","number":39692},{"kind":"pr","value":"#47747","number":47747},{"kind":"pr","value":"#44299","number":44299},{"kind":"pr","value":"#39685","number":39685}],"category":"duplicate_of","implication":"duplicate"},"merged":false},{"kind":"pr","number":57650,"title":"fix(agent): prefer native vision over auxiliary fallback in auto mode (#29135)","url":null,"state":"merged","close_reason":{"category":"merged"},"merged":true,"is_fix_pr":true,"fix_tier":"verified","files_changed":["agent/image_routing.py","tests/agent/test_image_routing.py"],"fix_hunks":[{"file":"agent/image_routing.py","hunks":["@@ -17,13 +17,17 @@\n | ``text``, default ``auto``) and the active model's capability metadata.\n \n In ``auto`` mode:\n-  - If the user has explicitly configured ``auxiliary.vision.provider``\n-    (i.e. not ``auto`` and not empty), we assume they want the text pipeline\n-    regardless of the main model — they've opted in to a specific vision\n-    backend for a reason (cost, quality, local-only, etc.).\n-  - Otherwise, if the active model reports ``supports_vision=True`` in its\n-    models.dev metadata, we attach natively.\n-  - Otherwise (non-vision model, no explicit override), we fall back to text.\n+  - If the active model reports ``supports_vision=True`` (via config\n+    override or models.dev metadata), we attach natively — vision-capable\n+    main models should always see the original pixels, even when an\n+    auxiliary vision backend is configured. That auxiliary backend then\n+    acts as a *fallback* for sessions whose main model can't take images.\n+  - Otherwise, if the user has explicitly configured ``auxiliary.vision``\n+    (provider/model/base_url not ``auto``/empty), we route through the\n+    text pipeline so the auxiliary vision backend can describe the image\n+    for the text-only main model.\n+  - Otherwise (non-vision model, no explicit override), we fall back to\n+    text via the default vision_analyze flow.\n \n This keeps ``vision_analyze`` surfaced as a tool in every session — skills\n and agent flows that chain it (browser screenshots, deeper inspection of","@@ -342,8 +346,10 @@ def _coerce_mode(raw: Any) -> str:\n def _explicit_aux_vision_override(cfg: Optional[Dict[str, Any]]) -> bool:\n     \"\"\"True when the user configured a specific auxiliary vision backend.\n \n-    An explicit override means the user *wants* the text pipeline (they're\n-    paying for a dedicated vision model), so we don't silently bypass it.\n+    An explicit override means the user has a dedicated vision backend\n+    available; it's used as a *fallback* when the main model can't take\n+    images natively. In ``auto`` mode, native vision on a vision-capable\n+    main model still wins over this fallback — see issue #29135.\n     \"\"\"\n     if not isinstance(cfg, dict):\n         return False","@@ -432,13 +438,15 @@ def decide_image_input_mode(\n     if mode_cfg == \"text\":\n         return \"text\"\n \n-    # auto\n-    if _explicit_aux_vision_override(cfg):\n-        return \"text\"\n-\n+    # auto: prefer native vision when the main model supports it. An\n+    # explicit auxiliary.vision config acts as a *fallback* for text-only\n+    # main models — it should not preempt native vision on a model that\n+    # can natively inspect the pixels (issue #29135).\n     supports = _lookup_supports_vision(provider, model, cfg)\n     if supports is True:\n         return \"native\"\n+    if _explicit_aux_vision_override(cfg):\n+        return \"text\"\n     return \"text\"\n \n "]},{"file":"tests/agent/test_image_routing.py","hunks":["@@ -97,11 +97,21 @@ def test_auto_with_unknown_model(self):\n         with patch(\"agent.image_routing._lookup_supports_vision\", return_value=None):\n             assert decide_image_input_mode(\"openrouter\", \"brand-new-slug\", {}) == \"text\"\n \n-    def test_auto_respects_aux_vision_override_even_for_vision_model(self):\n-        \"\"\"If the user configured a dedicated vision backend, don't bypass it.\"\"\"\n+    def test_auto_prefers_native_for_vision_capable_main_model_even_with_aux_configured(self):\n+        \"\"\"Regression #29135: vision-capable main model wins over aux fallback.\n+\n+        Auxiliary.vision is a fallback for text-only main models; it must\n+        not preempt native vision on a vision-capable main model.\n+        \"\"\"\n         cfg = {\"auxiliary\": {\"vision\": {\"provider\": \"openrouter\", \"model\": \"google/gemini-2.5-flash\"}}}\n         with patch(\"agent.image_routing._lookup_supports_vision\", return_value=True):\n-            assert decide_image_input_mode(\"anthropic\", \"claude-sonnet-4\", cfg) == \"text\"\n+            assert decide_image_input_mode(\"anthropic\", \"claude-sonnet-4\", cfg) == \"native\"\n+\n+    def test_auto_uses_aux_vision_fallback_for_text_only_main_model(self):\n+        \"\"\"#29135: aux vision still acts as fallback for non-vision main models.\"\"\"\n+        cfg = {\"auxiliary\": {\"vision\": {\"provider\": \"openrouter\", \"model\": \"google/gemini-2.5-flash\"}}}\n+        with patch(\"agent.image_routing._lookup_supports_vision\", return_value=False):\n+            assert decide_image_input_mode(\"deepseek\", \"deepseek-v4-pro\", cfg) == \"text\"\n \n     def test_none_config_is_auto(self):\n         with patch(\"agent.image_routing._lookup_supports_vision\", return_value=True):","@@ -325,15 +335,25 @@ def test_auto_text_for_custom_with_no_override(self):\n         with patch(\"agent.models_dev.get_model_capabilities\", return_value=None):\n             assert decide_image_input_mode(\"custom\", \"unknown\", {}) == \"text\"\n \n-    def test_explicit_aux_vision_override_still_wins(self):\n-        # If the user has configured a dedicated vision aux backend, respect\n-        # it even when supports_vision: true is also set.\n+    def test_explicit_aux_vision_no_longer_overrides_native_capable_main(self):\n+        # #29135: aux.vision is a fallback for text-only main models; it\n+        # must NOT preempt native routing when the main model can take\n+        # images directly (supports_vision: true).\n         cfg = {\n             \"model\": {\"supports_vision\": True},\n             \"auxiliary\": {\"vision\": {\"provider\": \"openrouter\", \"model\": \"gemini-2.5-pro\"}},\n         }\n         with patch(\"agent.models_dev.get_model_capabilities\", return_value=None):\n-            assert decide_image_input_mode(\"custom\", \"qwen3.6-35b\", cfg) == \"text\"\n+            assert decide_image_input_mode(\"custom\", \"qwen3.6-35b\", cfg) == \"native\"\n+\n+    def test_explicit_aux_vision_used_when_main_model_supports_vision_false(self):\n+        # #29135 counterpart: text-only main model + aux fallback → text.\n+        cfg = {\n+            \"model\": {\"supports_vision\": False},\n+            \"auxiliary\": {\"vision\": {\"provider\": \"openrouter\", \"model\": \"gemini-2.5-pro\"}},\n+        }\n+        with patch(\"agent.models_dev.get_model_capabilities\", return_value=None):\n+            assert decide_image_input_mode(\"custom\", \"deepseek-v4\", cfg) == \"text\"\n \n \n # ─── build_native_content_parts ──────────────────────────────────────────────\n"]}]},{"kind":"pr","number":144834,"title":"fix(vision): reshape tool-result images to user message for strict providers and prevent aux stream crashes","url":null,"state":"open","close_reason":{"category":"silent_close","implication":"active"},"merged":false}],"trust":{"default_tier":"verified","includes_suggested":false}}