refactor(hermes_cli): try/except-pass -> contextlib.suppress in setup flows

This commit is contained in:
Teknium
2026-09-02 21:05:31 -07:00
parent 3709a7334e
commit a6e3fe5f5b
5 changed files with 22 additions and 45 deletions

View File

@@ -7,6 +7,7 @@ tests patch them at call time). Prompt strings and config write order are behavi
from __future__ import annotations
import contextlib
import os
import subprocess
import urllib.parse
@@ -252,11 +253,9 @@ def _discover_named_custom_models(provider_info: dict, api_key: str, configured_
# (dashboard, desktop, ACP) show the full list; mirrors model_switch.py's
# _save_discovered_models_to_config. A failed save is non-fatal.
if live_models:
try:
with contextlib.suppress(Exception):
from hermes_cli.model_switch import _save_discovered_models_to_config
_save_discovered_models_to_config(base_url, live_models, api_mode=api_mode, headers=extra_headers or None)
except Exception:
pass
return models, native_catalog_empty