Skip to content

fix(discord): render provider model lists longer than 25 options across multiple select menus#71103

Open
EpicIsTheOne wants to merge 1 commit into
NousResearch:mainfrom
EpicIsTheOne:fix/discord-model-picker-multi-select
Open

fix(discord): render provider model lists longer than 25 options across multiple select menus#71103
EpicIsTheOne wants to merge 1 commit into
NousResearch:mainfrom
EpicIsTheOne:fix/discord-model-picker-multi-select

Conversation

@EpicIsTheOne

Copy link
Copy Markdown

Summary

The Discord /model picker built a single discord.ui.Select and filled it with models[: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 :free Portal 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 one discord.ui.Select per chunk (custom_id model_model_select_<i>), all routed through the existing _on_model_selected handler. 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 old min(len, 25).
  • Added regression test test_discord_model_picker_partition.py asserting all 37 Nous models render (including the :free tail), no truncation/dupes, and the per-menu 25-option cap holds.

Notes

  • Caps at 3 menus (75 models) given the 5-row limit; providers exceeding that would still clip, but none currently do.
  • No behavior change for providers with ≤25 models (still a single select).

Test plan

  • pytest tests/gateway/test_discord_model_picker.py tests/gateway/test_discord_model_picker_partition.py — 6 passed.
  • Verified live: list_authenticated_providers(current_provider="nous") emits 37 models; the Discord view now renders all 37 across 2 selects (25 + 12), with the 5 :free picks visible.

… 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
EpicIsTheOne force-pushed the fix/discord-model-picker-multi-select branch from eccf712 to 8898aff Compare July 25, 2026 00:49
@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins platform/discord Discord bot adapter P3 Low — cosmetic, nice to have needs-decision Awaiting maintainer decision before any implementation labels Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins needs-decision Awaiting maintainer decision before any implementation P3 Low — cosmetic, nice to have platform/discord Discord bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants