From a14fb3ab1ac4edb395d44eb35461d4f499498f72 Mon Sep 17 00:00:00 2001 From: Dev-Mriganka Date: Sat, 4 Apr 2026 19:46:15 +0530 Subject: [PATCH] fix(cli): guard fallback_model list format in save_config_value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a user manually sets fallback_model as a YAML list instead of a dict, save_config_value() crashes with: AttributeError: 'list' object has no attribute 'get' at the fb.get('provider') call on hermes_cli/config.py. The fix adds isinstance(fb, dict) so list-format values are treated as unconfigured — the fallback_model comment block is appended to guide correct usage — instead of crashing. Fixes #4091 Co-authored-by: [AI-assisted — Claude Sonnet 4.6 via Milo/Hermes] --- hermes_cli/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hermes_cli/config.py b/hermes_cli/config.py index fb8c0ca1f..30427bd25 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -3169,7 +3169,7 @@ def save_config(config: Dict[str, Any]): if not sec or sec.get("redact_secrets") is None: parts.append(_SECURITY_COMMENT) fb = normalized.get("fallback_model", {}) - if not fb or not (fb.get("provider") and fb.get("model")): + if not fb or not isinstance(fb, dict) or not (fb.get("provider") and fb.get("model")): parts.append(_FALLBACK_COMMENT) atomic_yaml_write(