fix: preserve discover_models in _normalize_custom_provider_entry#26766
Closed
darvsum wants to merge 1 commit into
Closed
fix: preserve discover_models in _normalize_custom_provider_entry#26766darvsum wants to merge 1 commit into
darvsum wants to merge 1 commit into
Conversation
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.
d76fcb0 to
452d624
Compare
teknium1
added a commit
that referenced
this pull request
May 17, 2026
…tors Adds release-note attribution mappings for 9 contributors from group 3: - @darvsum (PR #26766) - @hueilau (PR #26498) - @Timur00Kh (PR #27114) - @Grogger (PR #27061) - @lemassykoi (PR #27042) - @draplater (PR #26707) - @pr7426 (PR #27048) - @therahul-yo (PR #26215) - @flamiinngo (PR #27205) #27154 dropped from this batch — already landed on main as 4e9cedc.
Contributor
|
Merged via PR #27302 — your commit was cherry-picked onto current |
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
…tors Adds release-note attribution mappings for 9 contributors from group 3: - @darvsum (PR NousResearch#26766) - @hueilau (PR NousResearch#26498) - @Timur00Kh (PR NousResearch#27114) - @Grogger (PR NousResearch#27061) - @lemassykoi (PR NousResearch#27042) - @draplater (PR NousResearch#26707) - @pr7426 (PR NousResearch#27048) - @therahul-yo (PR NousResearch#26215) - @flamiinngo (PR NousResearch#27205) NousResearch#27154 dropped from this batch — already landed on main as 4e9cedc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
/api/model/optionstakes ~24s whencustom_providersinclude unreachable endpoints withdiscover_models: false.Root Cause
_normalize_custom_provider_entry()(hermes_cli/config.py) has two bugs:discover_modelsis not in_KNOWN_KEYS, so it is logged as an unknown key and discarded.discover_modelsis never carried through to the output.Downstream,
model_switch.pycallsentry.get("discover_models", True)and gets the defaultTrue, triggering/modelsHTTP probes on every custom_provider endpoint. Unreachable endpoints each timeout ~6s; with 4 such endpoints the total is ~24s.Fix
"discover_models"to_KNOWN_KEYS(suppresses the unknown-key warning).discover_modelsinto the normalized dict when present and boolean.Result
/api/model/optionsresponse time: 24.5s → 0.4s