From c6c2a5dcd27d27c22f129b2c9ca0c116def3ed41 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 2 Sep 2026 21:57:34 -0700 Subject: [PATCH] =?UTF-8?q?refactor(hermes=5Fcli):=20nous=5Fsubscription/k?= =?UTF-8?q?eepalive=20=E2=80=94=20reuse=20=5Fnorm,=20trim=20padding?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hermes_cli/nous_auth_keepalive.py | 1 - hermes_cli/nous_subscription.py | 10 +++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/hermes_cli/nous_auth_keepalive.py b/hermes_cli/nous_auth_keepalive.py index ae5538dc38..580408e8b5 100644 --- a/hermes_cli/nous_auth_keepalive.py +++ b/hermes_cli/nous_auth_keepalive.py @@ -67,7 +67,6 @@ def _interval_seconds(value: Optional[int]) -> int: return int(value) except (TypeError, ValueError): return NOUS_AUTH_KEEPALIVE_INTERVAL_SECONDS - raw = _nous_config().get(NOUS_AUTH_KEEPALIVE_INTERVAL_CONFIG_KEY) if raw is None or (isinstance(raw, str) and not raw.strip()): return NOUS_AUTH_KEEPALIVE_INTERVAL_SECONDS diff --git a/hermes_cli/nous_subscription.py b/hermes_cli/nous_subscription.py index 2c882d6652..5029a1374f 100644 --- a/hermes_cli/nous_subscription.py +++ b/hermes_cli/nous_subscription.py @@ -157,15 +157,15 @@ def _select_nous(config: Dict[str, object], key: str) -> None: section.pop("use_gateway", None) -def _provider_is_nous(config: Dict[str, object]) -> bool: - model_cfg = config.get("model") - return isinstance(model_cfg, dict) and str(model_cfg.get("provider") or "").strip().lower() == "nous" - - def _norm(value: object, default: str = "") -> str: return str(value or default).strip().lower() +def _provider_is_nous(config: Dict[str, object]) -> bool: + model_cfg = config.get("model") + return isinstance(model_cfg, dict) and _norm(model_cfg.get("provider")) == "nous" + + def _toolset_enabled(config: Dict[str, object], toolset_key: str) -> bool: """True when some platform's configured toolsets cover every tool of ``toolset_key``.""" from toolsets import resolve_toolset