Skip to content

The agent that grows with you

fix: migrate sibling custom-provider slug sites to custom_provider_slug

kshitijk4poor7b5a18817e59
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