From 443950e82736aa02c7ff61dda75426dbbbbdb161 Mon Sep 17 00:00:00 2001 From: Austin Pickett Date: Thu, 30 Apr 2026 18:38:54 -0400 Subject: [PATCH] fix(tui): pass user_providers as dict to match CLI model-switch pipeline MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The TUI's _apply_model_switch() was converting the config.yaml `providers:` dict into a list of dicts before passing it to switch_model(). This caused resolve_provider_full() → resolve_user_provider() to fail, since that function expects a dict and does `user_config.get(name)` to look up provider entries. The result: user-defined providers (e.g. ollama) appeared in CLI's /model picker but were invisible in the TUI. Fix: - tui_gateway/server.py: pass cfg.get('providers') directly (dict), matching what cli.py already does at line 5598. - hermes_cli/model_switch.py: fix the validation-override block (line ~893) which iterated user_providers as a list — now correctly handles the dict format with support for both dict-keyed and list-format models arrays. --- tui_gateway/server.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tui_gateway/server.py b/tui_gateway/server.py index 84b89a43..e3fd6698 100644 --- a/tui_gateway/server.py +++ b/tui_gateway/server.py @@ -1078,9 +1078,7 @@ def _apply_model_switch(sid: str, session: dict, raw_input: str) -> dict: from hermes_cli.config import get_compatible_custom_providers, load_config cfg = load_config() - user_provs = [ - {"provider": k, **v} for k, v in (cfg.get("providers") or {}).items() - ] + user_provs = cfg.get("providers") custom_provs = get_compatible_custom_providers(cfg) except Exception: pass