mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-06 05:17:15 +00:00
fix(providers): look up an alias owner only when a loaded profile claims the alias
The home-aware owner lookup ran for every non-static canonical id, so a registry stub (and any profile object without aliases) reached `owner.aliases`. Ask the listed profiles first: an id no profile names as an alias keeps what normalize_provider gave it, without calling get_provider_profile at all.
This commit is contained in:
1 parent
5dca2def3a
commit
72ffcb9788
1 file changed
+3
-1
@@ -269,7 +269,9 @@ def _plugin_alias_owner(canonical: str) -> str:
|
||||
if not canonical or _is_static_canonical(canonical):
|
||||
return canonical
|
||||
from providers import get_provider_profile, list_providers
|
||||
if any(prof.name == canonical for prof in list_providers()):
|
||||
profiles = list_providers()
|
||||
if any(prof.name == canonical for prof in profiles) or not any(
|
||||
canonical in prof.aliases for prof in profiles):
|
||||
return canonical
|
||||
owner = get_provider_profile(canonical)
|
||||
if owner is None or canonical not in owner.aliases or owner.provider_overlay:
|
||||
|
||||
Reference in new issue
Block a user