Skip to content

fix(model-picker): load all models in interactive pickers instead of capping at 50#35447

Closed
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/model-picker-show-all-models
Closed

fix(model-picker): load all models in interactive pickers instead of capping at 50#35447
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/model-picker-show-all-models

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

Removes the hard-coded max_models=50 cap from all interactive model pickers (CLI /model, TUI, gateway inline keyboards, dashboard API). Providers with more than 50 models (e.g. Nous Portal with 247) now show the full model list so users can select any model.

Related Issue

Fixes #35443

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • hermes_cli/model_switch.py: Accept max_models: int | None in list_authenticated_providers() and list_picker_providers(). When None, skip the model_ids[:max_models] slice so the full list passes through. Guard applied to all 4 slicing sites (Sections 1, 2a, 2b, and picker variant).
  • hermes_cli/inventory.py: Change build_models_payload() default from max_models=50 to max_models=None so callers get the full list by default.
  • cli.py: CLI /model picker — pass max_models=None.
  • gateway/run.py: Gateway inline-keyboard picker — pass max_models=None. (The separate max_models=5 in the status display is intentionally unchanged.)
  • tui_gateway/server.py: TUI model picker and provider refresh — pass max_models=None.
  • hermes_cli/web_server.py: Dashboard /api/model/options — pass max_models=None.

How to Test

  1. Configure a provider with >50 available models (e.g. Nous Portal).
  2. Run hermes CLI and type /model.
  3. Select the provider and verify all models are scrollable/selectable, not just the first 50.
  4. Repeat in the TUI (hermes --tui) and dashboard (hermes dashboard).
  5. Run pytest tests/hermes_cli/test_model_switch_custom_providers.py tests/hermes_cli/test_overlay_slug_resolution.py tests/test_tui_gateway_server.py -k model -q — all should pass.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Code Intelligence

  • Analyzed: hermes_cli/model_switch.py:list_authenticated_providers (called by build_models_payload → CLI/TUI/gateway/dashboard picker paths)
  • Blast radius: LOW — all changes are parameter value changes (50None) plus null-safe slicing guards
  • Related patterns: list_picker_providers wraps list_authenticated_providers for interactive pickers (Telegram/Discord inline keyboards)

…capping at 50

The /model picker (CLI, TUI, gateway, dashboard) truncated the model list
to 50 entries via max_models=50. Providers with >50 models (e.g. Nous Portal
with 247) showed the real total but only let users select from the first 50.

Fix: support max_models=None in list_authenticated_providers() and
list_picker_providers() to skip slicing, then pass None from all interactive
picker call sites. The max_models=5 limit in gateway status display is
unchanged (different purpose).

Fixes NousResearch#35443
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) comp/gateway Gateway runner, session dispatch, delivery labels May 30, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing with #35446 (CLI-only scope) and #27914 (hydrate truncated list). All three fix the same max_models=50 truncation from #35443. This PR has the broadest scope (CLI+TUI+gateway+dashboard).

@teknium1

Copy link
Copy Markdown
Contributor

Fixed on main via PR #48611 — the interactive model pickers no longer cap at 50 models; large provider catalogs are fully searchable.

This was one of several PRs targeting the same picker cap. We merged @islam666's #48297 as the implementation (cleanest scope — it correctly keeps the Telegram/Discord inline-keyboard cap, which genuinely needs a bound) plus a follow-up tightening max_models=0 semantics and a regression test. Closing this as a duplicate — thanks for the contribution and for flagging the issue.

#48611

@teknium1 teknium1 closed this Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/gateway Gateway runner, session dispatch, delivery comp/tui Terminal UI (ui-tui/ + tui_gateway/) P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI /model picker only exposes first 50 models despite larger provider catalog

3 participants