fix(discord): render provider model lists longer than 25 options across multiple select menus#71103
Open
EpicIsTheOne wants to merge 1 commit into
Open
Conversation
… select menus The Discord /model picker built a single discord.ui.Select filled with models[:25], silently dropping any models beyond the first 25. Discord caps a single select at 25 options but allows up to 5 component rows, so partition the list across up to 3 select menus (25 each; Back/Cancel use the other 2) instead of truncating. This fixes providers like Nous (curated list + Portal recommendations exceed 25) whose tail — including free-tier :free Portal picks — was previously clipped on Discord while showing fine in the Portal UI / CLI. - _build_model_select: slice into <=25-option chunks, one select per chunk (custom_id model_model_select_<i>), all via _on_model_selected. Multi-row menus get a (n/total) placeholder suffix. - _on_provider_selected: 'N more available' count reflects models actually rendered across the partitioned menus. - Add regression test covering the 37-model Nous case (no truncation/dupes, per-menu 25 cap holds).
EpicIsTheOne
force-pushed
the
fix/discord-model-picker-multi-select
branch
from
July 25, 2026 00:49
eccf712 to
8898aff
Compare
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 Discord
/modelpicker built a singlediscord.ui.Selectand filled it withmodels[:25], silently dropping any models beyond the first 25. Discord caps a single select at 25 options, but a message may contain up to 5 component rows — so the fix partitions the model list across up to 3 select menus (25 each; the other 2 rows are Back/Cancel), instead of truncating.Why
Providers like Nous expose more than 25 models (curated list + Portal recommendations). On Discord the tail was clipped, so e.g. free-tier
:freePortal picks (tencent/hy3:free,stepfun/step-3.7-flash:free, etc.) never appeared in the picker — they surfaced fine in the Portal UI / CLI, which don't use Discord's select widget. This makes the Discord picker match the other surfaces.Changes
ModelPickerView._build_model_select: slice the model list into ≤25-option chunks and emit onediscord.ui.Selectper chunk (custom_idmodel_model_select_<i>), all routed through the existing_on_model_selectedhandler. Multi-row menus get a(n/total)suffix in the placeholder._on_provider_selected: the "N more available" count now reflects models actually rendered across the partitioned menus rather than the oldmin(len, 25).test_discord_model_picker_partition.pyasserting all 37 Nous models render (including the:freetail), no truncation/dupes, and the per-menu 25-option cap holds.Notes
Test plan
pytest tests/gateway/test_discord_model_picker.py tests/gateway/test_discord_model_picker_partition.py— 6 passed.list_authenticated_providers(current_provider="nous")emits 37 models; the Discord view now renders all 37 across 2 selects (25 + 12), with the 5:freepicks visible.