From bde3c7982c30796f8709cb0041d34ab36a4d7a9c Mon Sep 17 00:00:00 2001 From: darvsum Date: Sat, 16 May 2026 13:18:01 +0800 Subject: [PATCH] fix: preserve discover_models in _normalize_custom_provider_entry The _normalize_custom_provider_entry() function was dropping the discover_models field from custom_provider entries because: 1. It was not listed in _KNOWN_KEYS, so it was logged as an unknown key and ignored. 2. The function builds the normalized dict by explicitly copying known fields, so even if the warning was suppressed, the value was not carried through. This caused downstream model_switch.py to default discover_models to True, triggering /models HTTP probes on unreachable endpoints. With 4 unreachable internal endpoints at ~6s timeout each, the /api/model/options endpoint took ~24s instead of <1s. --- hermes_cli/config.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hermes_cli/config.py b/hermes_cli/config.py index c41158e42ae..e4447183746 100644 --- a/hermes_cli/config.py +++ b/hermes_cli/config.py @@ -2914,6 +2914,7 @@ def _normalize_custom_provider_entry( "api_mode", "transport", "model", "default_model", "models", "context_length", "rate_limit_delay", "request_timeout_seconds", "stale_timeout_seconds", + "discover_models", } for camel, snake in _CAMEL_ALIASES.items(): if camel in entry and snake not in entry: @@ -3004,6 +3005,10 @@ def _normalize_custom_provider_entry( if isinstance(rate_limit_delay, (int, float)) and rate_limit_delay >= 0: normalized["rate_limit_delay"] = rate_limit_delay + discover_models = entry.get("discover_models") + if isinstance(discover_models, bool): + normalized["discover_models"] = discover_models + return normalized