mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-06-04 07:31:58 +00:00
fix(agent): resolve supports_vision override for named custom providers
Named custom providers are rewritten to provider="custom" at runtime (hermes_cli/runtime_provider.py:_resolve_named_custom_runtime), so a config under providers.my-vllm.models.my-llava.supports_vision was unreachable via self.provider alone. Also try cfg.model.provider as a candidate provider key, covering both runtime and config naming. Adds a regression test for the named-provider path.
This commit is contained in:
parent
24c7ce0fb8
commit
1c76689b28
2 changed files with 25 additions and 2 deletions
|
|
@ -186,6 +186,21 @@ class TestModelSupportsVision:
|
|||
patch("agent.models_dev.get_model_capabilities", return_value=None):
|
||||
assert agent._model_supports_vision() is True
|
||||
|
||||
def test_named_custom_provider_resolved_via_config_provider(self):
|
||||
# Named custom providers get runtime self.provider rewritten to
|
||||
# "custom" while the config keeps the original name under
|
||||
# model.provider. The override must still resolve.
|
||||
agent = _make_agent()
|
||||
agent.provider = "custom"
|
||||
agent.model = "my-llava"
|
||||
cfg = {
|
||||
"model": {"provider": "my-vllm", "default": "my-llava"},
|
||||
"providers": {"my-vllm": {"models": {"my-llava": {"supports_vision": True}}}},
|
||||
}
|
||||
with patch("hermes_cli.config.load_config", return_value=cfg), \
|
||||
patch("agent.models_dev.get_model_capabilities", return_value=None):
|
||||
assert agent._model_supports_vision() is True
|
||||
|
||||
def test_override_false_disables_vision_for_models_dev_models(self):
|
||||
agent = _make_agent()
|
||||
fake_caps = MagicMock()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue