fix(setup): skip AUXILIARY_VISION_MODEL write when input is blank

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 <balyan.sid@gmail.com>
This commit is contained in:
alt-glitch 2026-05-04 02:41:25 -07:00 committed by Teknium
parent 7d36533aeb
commit 2a52e28568

View file

@ -964,6 +964,7 @@ def setup_model_provider(config: dict, *, quick: bool = False):
) )
else: else:
_selected_vision_model = prompt(" Vision model (blank = use main/custom default)").strip() _selected_vision_model = prompt(" Vision model (blank = use main/custom default)").strip()
if _selected_vision_model:
save_env_value("AUXILIARY_VISION_MODEL", _selected_vision_model) save_env_value("AUXILIARY_VISION_MODEL", _selected_vision_model)
print_success( print_success(
f"Vision configured with {_base_url}" f"Vision configured with {_base_url}"