From f850bc58edc6cb18da80590baaa12f96ce291f48 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Mon, 7 Sep 2026 21:36:06 +0530 Subject: [PATCH] refactor(inventory): build the gated-Astra warning tail instead of string-replacing a sentence `warning.replace("Showing the saved model only.", ...)` silently no-ops the day that sentence is reworded. Pick the tail sentence first, format once. --- hermes_cli/inventory.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hermes_cli/inventory.py b/hermes_cli/inventory.py index 8d84ecdadd..eefb2f853c 100644 --- a/hermes_cli/inventory.py +++ b/hermes_cli/inventory.py @@ -421,15 +421,15 @@ def _append_unconfigured_rows( if entry.slug.lower() == cur: saved_model = "" if _model_requires_account_discovery(entry.slug, cur_model) else cur_model auth_type, key_env = _provider_auth_hint(entry.slug) - warning = ( - f"Configured provider missing usable credentials; paste {key_env} to reactivate. " - "Showing the saved model only." - if auth_type == "api_key" and key_env - else "Configured provider is not authenticated; run `hermes model` to reactivate. " - "Showing the saved model only." + tail = ( + "Astra requires successful account-scoped model discovery." + if cur_model and not saved_model else "Showing the saved model only." + ) + warning = ( + f"Configured provider missing usable credentials; paste {key_env} to reactivate. {tail}" + if auth_type == "api_key" and key_env + else f"Configured provider is not authenticated; run `hermes model` to reactivate. {tail}" ) - if cur_model and not saved_model: - warning = warning.replace("Showing the saved model only.", "Astra requires successful account-scoped model discovery.") extras.append(_canonical_row( entry, cur, models=[saved_model] if saved_model else [], total_models=1 if saved_model else 0, source="configured-current", authenticated=False, auth_type=auth_type, key_env=key_env,