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:
Teknium committed 2026-10-28 08:27:39 -07:00
1 parent 5dca2def3a
commit 72ffcb9788
1 file changed
+3 -1
+3 -1
View File
@@ -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: