feat(model): honor discover_models in terminal hermes model named-custom flow (closes #18726) - #40093
Merged
kshitijk4poor merged 1 commit intoJun 5, 2026
Conversation
…tom flow The terminal `hermes model` wizard (_model_flow_named_custom) always live-probed a custom provider's /models endpoint, ignoring the configured `models:` list. For plans whose endpoint exposes a large catalog (e.g. Baidu Qianfan Coding Plan returns 100+ models for a 2-3 model plan) the picker flooded with models the user can't use. This wires `discover_models` (and the `models:` list) through _named_custom_provider_map into the flow and honors `discover_models: false` the same way the slash-command picker (model_switch.py sections 3 & 4) does: - Default stays True — live probe, no behaviour change. - discover_models: false → use the configured `models:` list verbatim, skip the probe (string 'false'/'no'/'0' normalised to False). - If the probe is on but returns empty, fall back to the configured list instead of forcing manual entry. Closes NousResearch#18726
kshitijk4poor
enabled auto-merge
June 5, 2026 20:05
alt-glitch
pushed a commit
that referenced
this pull request
Jun 14, 2026
…er-models-18726 feat(model): honor discover_models in terminal hermes model named-custom flow (closes #18726)
T02200059
pushed a commit
to T02200059/hermes-agent
that referenced
this pull request
Jun 18, 2026
…ustom-discover-models-18726 feat(model): honor discover_models in terminal hermes model named-custom flow (closes NousResearch#18726)
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…ustom-discover-models-18726 feat(model): honor discover_models in terminal hermes model named-custom flow (closes NousResearch#18726)
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…ustom-discover-models-18726 feat(model): honor discover_models in terminal hermes model named-custom flow (closes NousResearch#18726)
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…ustom-discover-models-18726 feat(model): honor discover_models in terminal hermes model named-custom flow (closes NousResearch#18726)
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…ustom-discover-models-18726 feat(model): honor discover_models in terminal hermes model named-custom flow (closes NousResearch#18726)
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.
Summary
Fixes #18726 — the terminal
hermes modelwizard (_model_flow_named_custom) always live-probed a custom provider's/modelsendpoint and ignored the configuredmodels:list. For plans whose endpoint exposes a large catalog this floods the picker with models the user can't use (the issue's example: Baidu Qianfan Coding Plan returns 100+ models — ERNIE, embeddings, image models — for a 2–3 model plan).Root cause
Two gaps in the terminal flow (the slash-command
/modelpicker inmodel_switch.py§3/§4 already handles this):_named_custom_provider_map()built theprovider_infodict but dropped bothmodelsanddiscover_models, so the flow never received them._model_flow_named_custom()calledfetch_api_models()unconditionally.Fix (Option B — explicit opt-out, consistent with §3/§4 and #25810/#40080)
models+discover_modelsthrough_named_custom_provider_mapinto the flow.discover_models: false: use the configuredmodels:list verbatim and skip the live probe. String values ("false"/"no"/"0") normalise toFalse, matching the slash picker.True— no behaviour change for existing configs. Amodels:list alone does not implicitly whitelist (that would silently break the documented "configuremodels:for context-length overrides while still live-fetching" use case).models:list instead of forcing manual entry.Config (now works)
hermes model→ Baidu → shows exactly 2 models, no probe.Why not the implicit-whitelist default
The issue's literal ask was "no flag needed". I went with the explicit
discover_models: falseopt-out instead because: (1) it's one consistent mental model across every picker path (discover_models: false= "trust my list" everywhere — §3, §4, and now the terminal flow); (2) flipping the default would silently break configs that listmodels:purely for context-length overrides while relying on live discovery. The Baidu user adds one line and gets exactly the requested result.Tests
tests/hermes_cli/test_custom_provider_model_switch.py— newTestCustomProviderDiscoverModels(5 tests):discover_models: false+ configured models → no probe, list usedmodels:list (Option B guard)"false"normalises to disableAll pass. Verified end-to-end with a live call that raises if
fetch_api_modelsis touched underdiscover_models: false— probe is skipped, "Using configured models" shown, exactly the 2 configured models listed.Note: 3 unrelated tests in
test_model_switch_custom_providers.py(groups_same_endpoint,distinct_endpoints_stay_separate,total_models_reflects_grouped_count) fail identically on bareorigin/main— they don't mockfetch_api_modelsand probe a live local Ollama. Not touched by this PR.