From 705a10850d7fcf3db04f6a83432ab41ff8755aba Mon Sep 17 00:00:00 2001 From: Mariano Nicolini Date: Fri, 28 Aug 2026 17:00:26 -0300 Subject: [PATCH] refactor(nous): trim comments and drop unused code --- hermes_cli/models.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/hermes_cli/models.py b/hermes_cli/models.py index 9c81afb132..e2bd3a6682 100644 --- a/hermes_cli/models.py +++ b/hermes_cli/models.py @@ -2259,16 +2259,6 @@ def _cache_catalog( _PRICING_AUTH_KEY_SUFFIX = "\x00auth" -def _pricing_cache_key(url_root: str, api_key: str | None) -> str: - """Cache key for a read of *url_root*. - - A governed endpoint answers an authenticated read with a policy-filtered - catalog and an anonymous one with the full catalog, so the two cannot share - an entry. Only whether a key was supplied participates, never its value. - """ - return url_root + _PRICING_AUTH_KEY_SUFFIX if api_key else url_root - - def peek_cached_pricing(base_url: str) -> dict[str, dict[str, Any]]: """Pricing already cached for *base_url*, or ``{}``. Never fetches. @@ -2434,7 +2424,11 @@ def fetch_models_with_pricing( ``original``. """ url_root = (base_url or "").rstrip("/") - cache_key = _pricing_cache_key(url_root, api_key) + # A governed endpoint answers an authenticated read with a policy-filtered + # catalog and an anonymous one with the full catalog, so the two cannot + # share an entry. Only whether a key was supplied participates, never its + # value. + cache_key = url_root + _PRICING_AUTH_KEY_SUFFIX if api_key else url_root if not force_refresh: cached = _cached_catalog(cache_key) if cached is not None: