Skip to content

bug: /model slash command crashes when provider has >25 models (Discord Select Menu limit) #631

@sammylch

Description

@sammylch

Bug Description

The /model Discord slash command fails when the ACP agent backend (OpenCode) reports more than 25 available models. Discord's StringSelectMenu component has a hard limit of 25 options.

Error

From bot.log:

ERROR openab::discord: failed to respond to slash command
  error=Invalid Form Body (data.components.0.components.0.options: Must be between 1 and 25 in length.)
  category="model"

Discord shows: "The application did not respond"

Environment

  • OpenAB: built from source (latest main)
  • Agent: OpenCode (opencode acp)
  • Provider: OpenCode Go (reports 25+ models including GLM, Kimi, DeepSeek, Qwen, MiniMax, MiMo variants)
  • Platform: Discord

Steps to Reproduce

  1. Configure OpenAB with OpenCode as the agent backend
  2. Authenticate OpenCode with OpenCode Go provider (which has 25+ models)
  3. Type /model in a Discord channel
  4. Discord shows "The application did not respond"

Expected Behavior

The /model command should handle providers with >25 models gracefully.

Suggested Fix

  1. Truncate to 25 most relevant models (prioritize current provider)
  2. Paginate with multiple Select Menus or "Next page" button
  3. Text input — accept /model <name> as direct switch without Select Menu
  4. Filter by provider — show providers first, then models within that provider

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2Medium — planned work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions