From a62a137a4fb6d845a97097dbd71d948d56c87b62 Mon Sep 17 00:00:00 2001 From: teknium1 Date: Fri, 6 Mar 2026 21:11:40 -0800 Subject: [PATCH] fix: handle dict-format model config in setup wizard display config['model'] can be a dict (old format: {default, base_url, provider}) or a string (new format). The setup wizard was showing the raw dict in 'Keep current' and 'Model set to' messages. Now extracts the model name from either format. --- hermes_cli/setup.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/hermes_cli/setup.py b/hermes_cli/setup.py index cf0b914059..da45c3c67e 100644 --- a/hermes_cli/setup.py +++ b/hermes_cli/setup.py @@ -636,7 +636,8 @@ def setup_model_provider(config: dict): current_url = get_env_value("OPENAI_BASE_URL") or "" current_key = get_env_value("OPENAI_API_KEY") - current_model = config.get('model', '') + _raw_model = config.get('model', '') + current_model = _raw_model.get('default', '') if isinstance(_raw_model, dict) else (_raw_model or '') if current_url: print_info(f" Current URL: {current_url}") @@ -807,7 +808,8 @@ def setup_model_provider(config: dict): if selected_provider != "custom": # Custom already prompted for model name print_header("Default Model") - current_model = config.get('model', 'anthropic/claude-opus-4.6') + _raw_model = config.get('model', 'anthropic/claude-opus-4.6') + current_model = _raw_model.get('default', 'anthropic/claude-opus-4.6') if isinstance(_raw_model, dict) else (_raw_model or 'anthropic/claude-opus-4.6') print_info(f"Current: {current_model}") if selected_provider == "nous" and nous_models: @@ -929,8 +931,10 @@ def setup_model_provider(config: dict): save_env_value("LLM_MODEL", custom) # else: Keep current - if config.get('model'): - print_success(f"Model set to: {config['model']}") + _final_model = config.get('model', '') + if _final_model: + _display = _final_model.get('default', _final_model) if isinstance(_final_model, dict) else _final_model + print_success(f"Model set to: {_display}") save_config(config)