fix(picker): remove max_models=50 cap in interactive model pickers#48297
fix(picker): remove max_models=50 cap in interactive model pickers#48297Elshayib wants to merge 1 commit into
Conversation
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 NousResearch#48279
|
Duplicate of #35447 — identical mechanism. Both change Related: #48279 (the Kilo Gateway issue this fixes), #40747 (open competing fix that bumps the cap 50→200 instead of removing it), #40601/#42270/#35443 (issue cluster for the same picker cap). |
|
Appreciate the heads-up. Yes, #35447 and this PR address the same root cause (the hard-coded
This PR is a strict superset — it fixes every interactive picker path, not just the ones in #35447. I'd suggest we merge this one and close #35447. If maintainers disagree I'm happy to rebase on top. |
|
Merged to We added one follow-up on top: tightened the slicing guard from |
Summary
The interactive model pickers (Desktop REST API, TUI
model.options, CLI/model) were hard-capped atmax_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 — searching for a known model returned zero results even though it existed in the local cache.The
total_modelsfield was already present in the response payload but was never rendered by the Desktop UI, so users had no indication that the cap existed.Root Cause
build_models_payload()defaulted tomax_models=50andlist_authenticated_providers()defaulted tomax_models=8. All 5 interactive picker callers passedmax_models=50explicitly, truncating the model list before the picker ever saw the data.Changes
build_models_payload(): default changed frommax_models=50tomax_models=None(unlimited)list_authenticated_providers(): default changed frommax_models=8tomax_models=Nonelist_picker_providers(): default changed frommax_models=8tomax_models=None[:max_models]slicing updated to[:max_models] if max_models else model_idsto handleNoneas "no limit"max_models=50from 5 interactive picker callers:hermes_cli/web_server.py:get_model_options— Desktop/api/model/optionshermes_cli/web_server.py:get_recommended_default_model— Desktop recommended model endpointhermes_cli/model_switch.py:prewarm_picker_cache_async— picker cache prewarmtui_gateway/server.py:model.options— TUI JSON-RPC handlercli.py:HermesCLI— CLI/modelpickergateway/slash_commands.py) still passesmax_models=50explicitly — unchanged behavior (inline keyboards need a cap)test_build_models_payload_no_max_models_returns_full_listTesting
test_inventory.py(31 tests),test_list_picker_providers.py(10 tests),test_model_catalog.py(28 tests)max_modelsreturns the full 100-model listWhat platforms did you test on?
Linux (Ubuntu 26.04). The changes are in shared Python backend code — no platform-specific behavior.
Fixes #48279