From 9186ca7f499438eec132a21080abe463104cd382 Mon Sep 17 00:00:00 2001 From: Developer Date: Wed, 20 May 2026 20:52:01 -0500 Subject: [PATCH] fix(config): preserve api_key during provider migration for unauthenticated servers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v11→v12 config migration (custom_providers list → providers dict) stripped api_key values matching "no-key" or "no-key-required" from migrated entries. These are legitimate values used by self-hosted backends (llama.cpp, Ollama, vLLM, etc.) that expose an OpenAI-compatible /v1/models endpoint but don't require authentication. Without the api_key, model discovery is skipped entirely (see model_switch.py list_authenticated_providers Section 3), causing the /model picker to only show the single default_model instead of the full catalog. Users who add a placeholder api_key to work around this lose it on every config migration triggered by an update. Stop filtering out these values — only skip empty strings. If a user explicitly configured an api_key (even a placeholder), the migration should preserve it. Co-Authored-By: Claude Opus 4.7 --- hermes_cli/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hermes_cli/config.py b/hermes_cli/config.py index de8ca79cd88e9..c45d4000502f4 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -3617,7 +3617,7 @@ def migrate_config(interactive: bool = True, quiet: bool = False) -> Dict[str, A new_entry = {"api": old_url} if old_name: new_entry["name"] = old_name - if old_key and old_key not in {"no-key", "no-key-required", ""}: + if old_key and old_key not in {"",}: new_entry["api_key"] = old_key # Carry over model and api_mode if present