From c59ab8b0daa3a89267948d62ab709a992e99799c Mon Sep 17 00:00:00 2001 From: Teknium Date: Wed, 1 Apr 2026 13:45:18 -0700 Subject: [PATCH] fix: profile model.model promoted to model.default when default not set When a profile config sets model.model but not model.default, the hardcoded default (claude-opus-4.6) survived the config merge and took precedence in HermesCLI.__init__ because it checks model.default first. Profile model configs were silently ignored. Now model.model is promoted to model.default during the merge when the user didn't explicitly set model.default. Fixes #4486. --- cli.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cli.py b/cli.py index f7e45eded..e2b85f4bf 100644 --- a/cli.py +++ b/cli.py @@ -262,6 +262,14 @@ def load_cli_config() -> Dict[str, Any]: elif isinstance(file_config["model"], dict): # Old format: model is a dict with default/base_url defaults["model"].update(file_config["model"]) + # If the user config sets model.model but not model.default, + # promote model.model to model.default so the user's explicit + # choice isn't shadowed by the hardcoded default. Without this, + # profile configs that only set "model:" (not "default:") silently + # fall back to claude-opus because the merge preserves the + # hardcoded default and HermesCLI.__init__ checks "default" first. + if "model" in file_config["model"] and "default" not in file_config["model"]: + defaults["model"]["default"] = file_config["model"]["model"] # Legacy root-level provider/base_url fallback. # Some users (or old code) put provider: / base_url: at the