From fc01a2e3b400134dd523d8efabdde9c627ffaefd Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Wed, 2 Sep 2026 21:35:05 -0700 Subject: [PATCH] =?UTF-8?q?refactor(hermes=5Fcli):=20nous=5Fsubscription?= =?UTF-8?q?=20=E2=80=94=20iterate=20=5FFEATURES=20specs=20directly=20for?= =?UTF-8?q?=20managed=20map?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hermes_cli/nous_subscription.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/hermes_cli/nous_subscription.py b/hermes_cli/nous_subscription.py index 765dbc720f..16e5abdd43 100644 --- a/hermes_cli/nous_subscription.py +++ b/hermes_cli/nous_subscription.py @@ -470,12 +470,10 @@ def get_nous_subscription_features( config = load_config() or {} provider_is_nous = _provider_is_nous(config) account_info = _account_info_or_none(**({"force_fresh": True} if force_fresh else {})) - # Coarse "entitled to any managed tool" gate: paid access OR a live free tool pool. Per-backend # availability is then narrowed by coverage (the pool funds image but not video, etc.). - managed_tools_flag = bool(account_info and account_info.logged_in and account_info.tool_gateway_entitled) nous_auth_present = bool(account_info and account_info.logged_in) - + managed_tools_flag = nous_auth_present and account_info.tool_gateway_entitled enabled = {key: _toolset_enabled(config, key) for key in ("web", "image_gen", "video_gen", "tts", "browser", "terminal")} # Stored selections (strict model): "nous" = managed gateway; vendor name = that vendor direct; # None = never configured (autodetect). Lockstep with tool_backend_helpers.read_selection: a @@ -489,13 +487,11 @@ def get_nous_subscription_features( # credentials — managed availability must not light it up (the runtime errors, not reroutes). managed = { key: ( - managed_tools_flag - and nous_auth_present - and is_managed_tool_gateway_ready(_FEATURES[key].gateway) - and bool(account_info and account_info.tool_gateway_entitled_for(_FEATURES[key].coverage)) + managed_tools_flag and nous_auth_present and is_managed_tool_gateway_ready(spec.gateway) + and bool(account_info and account_info.tool_gateway_entitled_for(spec.coverage)) and (selected.get(key) is None or use_gateway[key]) ) - for key in _FEATURE_ORDER + for key, spec in _FEATURES.items() } direct_firecrawl = _any_env("FIRECRAWL_API_KEY", "FIRECRAWL_API_URL") and not use_gateway["web"] fal_configured = fal_key_is_configured()