From 6f53373eb2e85b2fb58b2a3eb949574e76bc93f9 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 14 Aug 2026 01:20:02 -0700 Subject: [PATCH] fix(cli): route startup guard through the selection-guard registry; cover the light oneshot fast-path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-ups on top of the salvaged #70324: - _confirm_startup_expensive_model_override evaluates the unified registry (combined_selection_warning) so id-keyed guards like the data-training-tier warning fire at startup too, not just the cost guard. - The Termux-adjacent light oneshot fast-path (added after the PR branched) ran _run_and_exit_oneshot without the guard — same bug class, third sibling site now covered. --- hermes_cli/main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hermes_cli/main.py b/hermes_cli/main.py index abf48e320f..b58a6c0c18 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -1087,7 +1087,7 @@ def _confirm_startup_expensive_model_override(args) -> None: try: from hermes_cli.config import load_config - from hermes_cli.model_cost_guard import expensive_model_warning + from hermes_cli.model_selection_guards import combined_selection_warning except Exception as exc: logger.warning("startup model cost guard unavailable: %s", exc) return @@ -1105,7 +1105,9 @@ def _confirm_startup_expensive_model_override(args) -> None: return provider = (explicit_provider or model_cfg.get("provider") or "").strip() try: - warning = expensive_model_warning( + # Unified registry: cost guard + id-keyed guards (e.g. the + # data-training-tier warning) all fire at startup too. + warning = combined_selection_warning( model, provider=provider, base_url=(model_cfg.get("base_url") or ""), @@ -11233,6 +11235,7 @@ def _try_fast_chat_launch() -> bool: _prepare_agent_startup(args) if getattr(args, "oneshot", None): + _confirm_startup_expensive_model_override(args) _run_and_exit_oneshot( args.oneshot, model=getattr(args, "model", None),