fix(image-routing): check native vision support before aux override - #44320
Closed
liuhao1024 wants to merge 1 commit into
Closed
fix(image-routing): check native vision support before aux override#44320liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
When the main model supports vision natively (supports_vision=True), use it directly instead of routing through the auxiliary vision LLM. This fixes a bug where explicit auxiliary.vision config unconditionally blocked native vision, adding unnecessary latency and causing failures for providers that reject multimodal tool_result messages (e.g. Xiaomi MiMo). The fix swaps the check order in decide_image_input_mode(): native vision support is checked first, and the aux override only applies when the main model does NOT support vision. Closes NousResearch#44299
Collaborator
Contributor
Author
|
Thanks for the flag @alt-glitch. Comparing the two PRs:
Both implement the same fix for #44299. The code changes are equivalent; this PR adds slightly more test coverage. Happy to close if #44305 is preferred. |
Contributor
Author
|
Thanks for the flag @alt-glitch. Confirmed — #44305 has the same reorder (check native vision before aux override) and was opened earlier the same day. Closing in favor of #44305. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When
auxiliary.visionis explicitly configured inconfig.yaml,_explicit_aux_vision_override()forces all images through the auxiliary vision LLM text pipeline — even when the main model itself supports vision natively (e.g.mimo-v2.5withsupports_vision=True).This causes two issues:
tool_resultmessages get HTTP 400 errors when images are routed through the auxiliary pipelineRoot Cause
In
agent/image_routing.py,decide_image_input_mode()checks_explicit_aux_vision_override()before checking native vision support:Fix
Swap the check order: verify native vision support first, then fall through to aux override only when the main model does NOT support vision:
Changes
agent/image_routing.py— Swap check order indecide_image_input_mode()tests/agent/test_image_routing.py— Update 2 tests to reflect new priority (native wins over aux), add 1 test for aux fallback when main model lacks visionTesting
Closes #44299