mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-18 04:41:56 +00:00
fix(doctor): normalize provider name and aliases before dedicated-skip check
This commit is contained in:
parent
1dd0790654
commit
6e848f60ef
1 changed files with 9 additions and 1 deletions
|
|
@ -254,13 +254,21 @@ def _build_apikey_providers_list() -> list:
|
|||
try:
|
||||
from providers import list_providers
|
||||
from providers.base import ProviderProfile as _PP
|
||||
try:
|
||||
from hermes_cli.providers import normalize_provider as _normalize_provider
|
||||
except Exception: # pragma: no cover - normalization is best-effort
|
||||
def _normalize_provider(_name: str) -> str:
|
||||
return (_name or "").strip().lower()
|
||||
for _pp in list_providers():
|
||||
if not isinstance(_pp, _PP) or _pp.auth_type != "api_key" or not _pp.env_vars:
|
||||
continue
|
||||
_label = _pp.display_name or _pp.name
|
||||
if _label in _known_names or _pp.name in _known_canonical:
|
||||
continue
|
||||
if any(_alias in _dedicated_canonical for _alias in (_pp.aliases or ())):
|
||||
_candidates = {_normalize_provider(_pp.name)}
|
||||
for _alias in (_pp.aliases or ()):
|
||||
_candidates.add(_normalize_provider(_alias))
|
||||
if _candidates & _dedicated_canonical:
|
||||
continue
|
||||
# Separate API-key vars from base-URL override vars — the health-check
|
||||
# loop sends the first found value as Authorization: Bearer, so a URL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue