mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-29 06:31:32 +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
12
run_agent.py
12
run_agent.py
|
|
@ -3213,8 +3213,16 @@ class AIAgent:
|
|||
cfg = load_config()
|
||||
provider = (getattr(self, "provider", "") or "").strip()
|
||||
model = (getattr(self, "model", "") or "").strip()
|
||||
for keys in (("model", "supports_vision"),
|
||||
("providers", provider, "models", model, "supports_vision")):
|
||||
# self.provider is the runtime-resolved value, which is rewritten
|
||||
# to "custom" for named custom providers (see
|
||||
# hermes_cli/runtime_provider.py:_resolve_named_custom_runtime),
|
||||
# while the config still holds the user-declared name (e.g.
|
||||
# "my-vllm") under model.provider. Try both as provider keys.
|
||||
config_provider = str(cfg_get(cfg, "model", "provider") or "").strip()
|
||||
candidates = [("model", "supports_vision")]
|
||||
for p in dict.fromkeys(filter(None, (provider, config_provider))):
|
||||
candidates.append(("providers", p, "models", model, "supports_vision"))
|
||||
for keys in candidates:
|
||||
override = cfg_get(cfg, *keys)
|
||||
if override is not None:
|
||||
return bool(override)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue