From 7b5a18817e5952a1f4d60edd30fc034c10eb16e3 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Thu, 30 Jul 2026 21:17:28 +0500 Subject: [PATCH] fix: migrate sibling custom-provider slug sites to custom_provider_slug find_custom_provider_identity_by_model (runtime_provider.py:895,908) and acp_adapter/server.py:149 still used the old f"custom:{_normalize_custom_provider_name(...)}" pattern while the rest of the codebase migrated to custom_provider_slug. For keyed providers whose display name differs from their config key, the model-based reverse lookup would return custom: instead of the stable custom: identity every other code path returns. Co-authored-by: Gille <4317663+helix4u@users.noreply.github.com> --- acp_adapter/server.py | 4 ++-- hermes_cli/runtime_provider.py | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/acp_adapter/server.py b/acp_adapter/server.py index 7fee2d932f8..1b0046fe32c 100644 --- a/acp_adapter/server.py +++ b/acp_adapter/server.py @@ -114,6 +114,7 @@ def _named_custom_provider_catalogs() -> list[tuple[str, str, list[tuple[str, st load_config, ) from hermes_cli.models import fetch_api_models + from hermes_cli.providers import custom_provider_slug except ImportError: return [] @@ -145,8 +146,7 @@ def _named_custom_provider_catalogs() -> list[tuple[str, str, list[tuple[str, st base_url = str(entry.get("base_url", "") or "").strip() if not name or not base_url: continue - slug_source = provider_key or name - slug = "custom:" + slug_source.strip().lower().replace(" ", "-") + slug = custom_provider_slug(name, provider_key) api_key = str(entry.get("api_key", "") or "").strip() if not api_key: diff --git a/hermes_cli/runtime_provider.py b/hermes_cli/runtime_provider.py index c92f0b7fc97..c96f333d636 100644 --- a/hermes_cli/runtime_provider.py +++ b/hermes_cli/runtime_provider.py @@ -892,7 +892,7 @@ def find_custom_provider_identity_by_model(model: str) -> Optional[str]: if not isinstance(entry, dict): continue if _entry_serves_model(entry): - return f"custom:{_normalize_custom_provider_name(str(ep_name))}" + return custom_provider_slug(str(ep_name), str(ep_name)) try: custom_providers = get_compatible_custom_providers(config) @@ -905,7 +905,10 @@ def find_custom_provider_identity_by_model(model: str) -> Optional[str]: if not isinstance(name, str) or not name.strip(): continue if _entry_serves_model(entry): - return f"custom:{_normalize_custom_provider_name(name)}" + return custom_provider_slug( + name, + str(entry.get("provider_key", "") or ""), + ) return None