feat(model-picker): group custom_providers by name into a single row per provider#8011
Closed
akhater wants to merge 1 commit into
Closed
feat(model-picker): group custom_providers by name into a single row per provider#8011akhater wants to merge 1 commit into
akhater wants to merge 1 commit into
Conversation
…per provider The /model picker currently renders one row per ``custom_providers`` entry. When several entries share the same provider name (e.g. four ``ollama-cloud`` entries for ``qwen3-coder``, ``glm-5.1``, ``kimi-k2``, ``minimax-m2.7``), users see four separate "Ollama Cloud" rows in the picker, which is confusing UX — there is only one Ollama Cloud provider, so there should be one row containing four models. This PR groups ``custom_providers`` entries that share the same provider name into a single picker row while keeping entries with distinct names as separate rows. So: * Four entries named ``Ollama Cloud`` → one "Ollama Cloud" row with four models inside. * One entry named ``Ollama Cloud`` and one named ``Moonshot`` → two separate rows, one model each. Implementation -------------- Replaces the single-pass loop in ``list_authenticated_providers()`` with a two-pass approach: 1. First pass: build an ``OrderedDict`` keyed by ``custom_provider_slug(name)``, accumulating ``models`` per group while preserving discovery order. 2. Second pass: iterate the groups and append one result row per group, skipping any slug that already appeared in an earlier provider source (the existing ``seen_slugs`` guard). Insertion order is preserved via ``OrderedDict``, so providers and their models still appear in the order the user listed them in ``custom_providers``. No new dependencies. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 tasks
Contributor
ulasbilgen
pushed a commit
to ulasbilgen/hermes-adhd-agent
that referenced
this pull request
May 1, 2026
… grouping Tests for salvaged PRs NousResearch#9233 and NousResearch#8011.
aj-nt
pushed a commit
to aj-nt/hermes-agent
that referenced
this pull request
May 1, 2026
… grouping Tests for salvaged PRs NousResearch#9233 and NousResearch#8011.
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
… grouping Tests for salvaged PRs NousResearch#9233 and NousResearch#8011.
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
… grouping Tests for salvaged PRs NousResearch#9233 and NousResearch#8011.
Egavasyug
pushed a commit
to Egavasyug/hermes-agent
that referenced
this pull request
Jun 10, 2026
… grouping Tests for salvaged PRs NousResearch#9233 and NousResearch#8011.
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
The
/modelpicker currently renders one row percustom_providersentry. When several entries share the same provider name (e.g. fourollama-cloudentries forqwen3-coder,glm-5.1,kimi-k2,minimax-m2.7), users see four separate ""Ollama Cloud"" rows in the picker, which is confusing UX — there is only one Ollama Cloud provider, so there should be one row containing four models.This PR groups
custom_providersentries that share the same provider name into a single picker row, while keeping entries with distinct names as separate rows.Before
```
custom_providers:
base_url: https://ollama.com/v1
model: qwen3-coder:480b-cloud
base_url: https://ollama.com/v1
model: glm-5.1:cloud
base_url: https://ollama.com/v1
model: kimi-k2.5
base_url: https://ollama.com/v1
model: minimax-m2.7:cloud
base_url: https://api.moonshot.ai/v1
model: kimi-k2-thinking
```
picker:
```
```
After
```
```
Each provider gets one row, and the picker drills into the model list when the user selects it — same as the curated providers (Anthropic, OpenAI, etc.) already do.
Implementation
Replaces the single-pass loop in
list_authenticated_providers()(hermes_cli/model_switch.py) with a two-pass approach:OrderedDictkeyed bycustom_provider_slug(name), accumulatingmodelsper group while preserving discovery order.seen_slugsguard is preserved).Insertion order is preserved via
OrderedDict, so providers and their models still appear in the order the user listed them incustom_providers. No new dependencies.What's preserved
seen_slugsskip logic — providers already registered by an earlier source (curated providers, user-defined endpoints) still take precedence overcustom_providersentries with the same slug.not display_name or not api_urlskip — entries missing either field are still ignored.base_url/url/apiprecedence is unchanged.current provider first, then by model count descendingstill applies, so the user's active provider always floats to the top and the grouped row's highertotal_modelscorrectly reflects the new behaviour.Files
hermes_cli/model_switch.py— single function (list_authenticated_providers), 25 inserted / 10 removed.Test plan
/modelagainst a config with multipleOllama Cloudentries shows one grouped row instead of four duplicates.seen_slugsprecedence still applies —custom_providersentries do not override curated providers with the same slug.ast.parse+from hermes_cli.model_switch import list_authenticated_providers).list_authenticated_providersif reviewers want one before merge — the function is pure (config in, list out), so a test against a synthetic config dict is straightforward.Related PRs
This builds naturally on top of #7261 (
custom_providerslist schema support) and #7267 (hide providers with no curated LLM models). Both are still open. This PR does not depend on either being merged first — it stands alone against currentmain.🤖 Generated with Claude Code