diff --git a/cli.py b/cli.py index abd4d2391e..424594acf8 100644 --- a/cli.py +++ b/cli.py @@ -3176,7 +3176,14 @@ class HermesCLI: # the configured model (e.g. "qwen3.6-plus"), causing 400 errors. runtime_model = runtime.get("model") if runtime_model and isinstance(runtime_model, str): - self.model = runtime_model + # Only use runtime model if: model is unset, or model equals provider name + should_use_runtime_model = ( + not self.model or # No model configured yet + self.model == self.provider or # Model is the provider slug + self.model == runtime.get("name") # Model matches provider display name + ) + if should_use_runtime_model: + self.model = runtime_model # If model is still empty (e.g. user ran `hermes auth add openai-codex` # without `hermes model`), fall back to the provider's first catalog