Skip to content

fix(picker): remove max_models=50 cap in interactive model pickers#48611

Merged
teknium1 merged 2 commits into
mainfrom
salvage/48297-picker-cap
Jun 18, 2026
Merged

fix(picker): remove max_models=50 cap in interactive model pickers#48611
teknium1 merged 2 commits into
mainfrom
salvage/48297-picker-cap

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

The interactive model pickers no longer cap at 50 models — large provider catalogs (e.g. Kilo Gateway's 336) are now fully searchable. Searching for a model that existed in cache but ranked past the first 50 previously returned zero results.

Salvages #48297 by @islam666 (cherry-picked, authorship preserved) plus a follow-up correctness fix on top.

Changes

  • build_models_payload() / list_authenticated_providers() / list_picker_providers(): default max_modelsNone (unlimited)
  • Removed the explicit max_models=50 from the 5 interactive picker callers: Desktop /api/model/options, Desktop recommended-default, picker prewarm, TUI model.options, CLI /model
  • Telegram/Discord inline keyboard picker keeps its cap — unchanged by design (inline keyboards need a bound)
  • Follow-up (ours): tightened the slicing guard from if max_models to if max_models is not None at all 5 sites, so max_models=0 keeps its "empty model list" meaning for the slug-only callers instead of being conflated with unlimited

Validation

max_models Before After
default (interactive) 50 (truncated) unlimited
None n/a full list
0 empty empty (preserved)
N first N first N

Regression tests: contributor's test_build_models_payload_no_max_models_returns_full_list (None=unlimited) + new test_picker_max_models_cap_semantics locking the three-way contract (None=full, 0=empty, N=first N) on the real slicing path. tests/hermes_cli/ (7130) and tests/tui_gateway/ (148) all green.

Test plan

  • scripts/run_tests.sh tests/hermes_cli tests/tui_gateway → all passed

Supersedes the duplicate cluster: #35446, #35447, #40765, #42496, #27914, #41029.

Infographic

Model picker cap removed — before/after roster grid, 5 interactive pickers uncapped, cap modes none=ALL/0=NONE/N=first N, inline keyboard still capped by design

islam666 and others added 2 commits June 18, 2026 12:37
The interactive model pickers (Desktop REST API, TUI model.options, CLI
/model) were hard-capped at max_models=50, which truncated large provider
catalogs like Kilo Gateway (336 models) to just 50 entries. This made
most models undiscoverable via the picker search box.

Changes:
- Change build_models_payload() default from max_models=50 to None (unlimited)
- Change list_authenticated_providers() default from max_models=8 to None
- Change list_picker_providers() default from max_models=8 to None
- Fix all [:max_models] slicing to handle None as 'no limit'
- Remove max_models=50 from 5 interactive picker callers:
  * web_server.py: get_model_options (Desktop /api/model/options)
  * web_server.py: get_recommended_default_model
  * model_switch.py: prewarm_picker_cache_async
  * tui_gateway/server.py: model.options JSON-RPC
  * cli.py: HermesCLI model picker
- Telegram/Discord inline keyboard picker (gateway/slash_commands.py)
  still passes max_models=50 explicitly — unchanged behavior.

The total_models field was already in the response payload and is now
meaningful since models.length == total_models for interactive pickers.

Fixes #48279
…ntics

Follow-up to the cap-removal salvage. The contributor guarded the new
unlimited default with `[:max_models] if max_models else ...`, which conflates
max_models=0 (used by slug-only callers that want an empty model list) with
None (unlimited). Tighten to `is not None` at all five slicing sites in
list_authenticated_providers / list_picker_providers, and add a regression test
asserting the three-way contract: None=full, 0=empty, N=first N.
@github-actions

Copy link
Copy Markdown
Contributor

🔎 Lint report: salvage/48297-picker-cap vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 11025 on HEAD, 11025 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 5776 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added type/bug Something isn't working P1 High — major feature broken, no workaround comp/cli CLI entry point, hermes_cli/, setup wizard comp/tui Terminal UI (ui-tui/ + tui_gateway/) labels Jun 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related: #48297 (@islam666's original, cherry-picked here with authorship preserved), #48279 (the Kilo Gateway bug report this Fixes), and the earlier cap-removal attempts #35446, #35447, #40765, #42496, #27914, #41029.

This is the authoritative salvage that supersedes the cluster — it removes the max_models=50 cap at all 5 interactive picker call sites and adds the is not None slicing guard so max_models=0 keeps its "empty list" meaning for slug-only callers. The Telegram/Discord inline-keyboard cap is intentionally left in place.

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/tui Terminal UI (ui-tui/ + tui_gateway/) P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants