From a8a05c8ea73f08f4660664de0b16e2f729fb8850 Mon Sep 17 00:00:00 2001 From: Julien Talbot Date: Sun, 10 May 2026 19:43:28 +0400 Subject: [PATCH] feat(cli): warn about retired xAI models at chat startup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Print a non-blocking stderr warning at the top of cmd_chat when the active config still references xAI models scheduled for retirement on May 15, 2026. Each line includes the config path, the recommended replacement, and the reasoning_effort to set for non-reasoning variants. Points to hermes doctor for full diagnostic. Wrapped in try/except — never blocks startup. After May 15 the upstream xAI API will return a clear error anyway; this is purely a heads-up to give users time to migrate before that happens. --- hermes_cli/main.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/hermes_cli/main.py b/hermes_cli/main.py index 1a14a1e0fe9..df379e7918b 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -1384,6 +1384,29 @@ def cmd_chat(args): # If resolution fails, keep the original value — _init_agent will # report "Session not found" with the original input + # xAI retirement warning — one-shot, non-blocking, never fails startup + try: + from hermes_cli.xai_retirement import ( + MIGRATION_GUIDE_URL, + RETIREMENT_DATE, + find_retired_xai_refs, + format_issue, + ) + from hermes_cli.config import load_config as _load_config_for_xai_check + + _retired_xai_refs = find_retired_xai_refs(_load_config_for_xai_check()) + if _retired_xai_refs: + sys.stderr.write( + f"\033[33m⚠ xAI retires {len(_retired_xai_refs)} model(s) " + f"in your config on {RETIREMENT_DATE}:\033[0m\n" + ) + for _ref in _retired_xai_refs: + sys.stderr.write(f" \033[33m⚠\033[0m {format_issue(_ref)}\n") + sys.stderr.write(f" \033[2mMigration guide: {MIGRATION_GUIDE_URL}\033[0m\n") + sys.stderr.write(" \033[2mRun 'hermes doctor' for details.\033[0m\n\n") + except Exception: + pass + # First-run guard: check if any provider is configured before launching if not _has_any_provider_configured(): print()