diff --git a/hermes_cli/config.py b/hermes_cli/config.py index f5985556c..bb004d944 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -1903,7 +1903,7 @@ DEFAULT_CONFIG = { # Disk cache TTL in hours. Beyond this, the CLI refetches on the # next /model or `hermes model` invocation; network failures # silently fall back to the stale cache. - "ttl_hours": 24, + "ttl_hours": 1, # Optional per-provider override URLs for third parties that want # to self-host their own curation list using the same schema. # Example: @@ -2151,7 +2151,7 @@ DEFAULT_CONFIG = { # Config schema version - bump this when adding new required fields - "_config_version": 24, + "_config_version": 25, } # ============================================================================= @@ -4344,6 +4344,22 @@ def migrate_config(interactive: bool = True, quiet: bool = False) -> Dict[str, A f"{', '.join(added_aux)}" ) + # ── Version 24 → 25: lower model_catalog TTL 24h → 1h ── + # The model picker now refreshes its curated list hourly so freshly + # published model-catalog.json deploys reach users without a day-long + # stale window. Only rewrite the OLD default (24) — never clobber a + # value the user deliberately customized. + if current_ver < 25: + config = read_raw_config() + raw_mc = config.get("model_catalog") + if isinstance(raw_mc, dict) and raw_mc.get("ttl_hours") == 24: + raw_mc["ttl_hours"] = 1 + config["model_catalog"] = raw_mc + save_config(config) + results["config_added"].append("model_catalog.ttl_hours 24→1") + if not quiet: + print(" ✓ Lowered model_catalog.ttl_hours to 1 (hourly picker refresh)") + if current_ver < latest_ver and not quiet: print(f"Config version: {current_ver} → {latest_ver}") diff --git a/hermes_cli/model_catalog.py b/hermes_cli/model_catalog.py index 703d95840..f69791340 100644 --- a/hermes_cli/model_catalog.py +++ b/hermes_cli/model_catalog.py @@ -73,7 +73,7 @@ DEFAULT_CATALOG_URL = ( DEFAULT_CATALOG_FALLBACK_URLS: tuple[str, ...] = ( "https://raw.githubusercontent.com/NousResearch/hermes-agent/main/website/static/api/model-catalog.json", ) -DEFAULT_TTL_HOURS = 24 +DEFAULT_TTL_HOURS = 1 DEFAULT_FETCH_TIMEOUT = 8.0 SUPPORTED_SCHEMA_VERSION = 1