From 2a52e285685750c5f60d785c072fc394a84136a0 Mon Sep 17 00:00:00 2001 From: alt-glitch Date: Mon, 4 May 2026 02:41:25 -0700 Subject: [PATCH] fix(setup): skip AUXILIARY_VISION_MODEL write when input is blank MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Guard the save_env_value('AUXILIARY_VISION_MODEL', ...) call with 'if _selected_vision_model:' so blank input at the non-OpenAI vision model prompt doesn't nuke existing values in .env. save_env_value has no internal guard against empty strings — it faithfully writes whatever it receives, including empty values that shadow the previously-configured model. Salvage of #15504 (core hunk). Contributor's test was dropped because it collided with subsequent test refactors; the fix stands on its own. Co-authored-by: alt-glitch --- hermes_cli/setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hermes_cli/setup.py b/hermes_cli/setup.py index e8c2b3b6fc..63f5267ddf 100644 --- a/hermes_cli/setup.py +++ b/hermes_cli/setup.py @@ -964,7 +964,8 @@ def setup_model_provider(config: dict, *, quick: bool = False): ) else: _selected_vision_model = prompt(" Vision model (blank = use main/custom default)").strip() - save_env_value("AUXILIARY_VISION_MODEL", _selected_vision_model) + if _selected_vision_model: + save_env_value("AUXILIARY_VISION_MODEL", _selected_vision_model) print_success( f"Vision configured with {_base_url}" + (f" ({_selected_vision_model})" if _selected_vision_model else "")