fix(computer_use): honor custom vision routing
This commit is contained in:
parent
ffe665277c
commit
591e6fb8f4
6 changed files with 207 additions and 7 deletions
|
|
@ -160,6 +160,42 @@ class TestRouteDecision:
|
|||
"some-aggregator", "some-vision-model", {}
|
||||
) is True
|
||||
|
||||
def test_user_declared_vision_support_keeps_custom_provider_native(self):
|
||||
"""Local/custom VLMs use config as their tool-result image escape hatch."""
|
||||
from tools.computer_use import vision_routing
|
||||
|
||||
cfg = {
|
||||
"model": {
|
||||
"default": "Qwen3.6-35B-A3B-local-vlm",
|
||||
"provider": "omlx",
|
||||
"supports_vision": True,
|
||||
}
|
||||
}
|
||||
with patch.object(vision_routing,
|
||||
"_provider_accepts_multimodal_tool_result",
|
||||
return_value=False):
|
||||
assert vision_routing.should_route_capture_to_aux_vision(
|
||||
"custom", "Qwen3.6-35B-A3B-local-vlm", cfg
|
||||
) is False
|
||||
|
||||
def test_user_declared_no_vision_routes_custom_provider_to_aux(self):
|
||||
"""An explicit false override should not fall through to native routing."""
|
||||
from tools.computer_use import vision_routing
|
||||
|
||||
cfg = {
|
||||
"model": {
|
||||
"default": "local-text-model",
|
||||
"provider": "omlx",
|
||||
"supports_vision": False,
|
||||
}
|
||||
}
|
||||
with patch.object(vision_routing,
|
||||
"_provider_accepts_multimodal_tool_result",
|
||||
return_value=True):
|
||||
assert vision_routing.should_route_capture_to_aux_vision(
|
||||
"custom", "local-text-model", cfg
|
||||
) is True
|
||||
|
||||
def test_unknown_provider_capabilities_fail_closed(self):
|
||||
"""When tool-result lookup returns None, route to aux (safe default)."""
|
||||
from tools.computer_use import vision_routing
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue