feat: interactive model picker with Discord Select UI and reasoning selector (#3710) - #3755
Closed
simplenamebox-ops wants to merge 8 commits into
Closed
Conversation
added 2 commits
March 29, 2026 18:09
…usResearch#3710) Adds /models command with Discord Select menu dropdowns (not button/text flow), /model-status showing configured vs actual vs cron models, and reasoning effort selector in the picker. - ModelPickerView: provider dropdown → model dropdown → reasoning dropdown → Submit - Guild-level slash sync for instant command availability - apply_model_selection() direct config write (no /model chat message interception) - model_picker_config.py: models.yaml catalog loader with favourites support - /model-status: shows configured, last-used (with fallback indicator), and cron models
simplenamebox-ops
force-pushed
the
feat/interactive-model-picker-discord
branch
from
March 29, 2026 17:21
7bfd2c9 to
5520f1b
Compare
Restores session-scoped model switching that was removed when /model was deleted in 9783c9d. The /models picker now sets a gateway-level override instead of writing to config.yaml: - Config keeps the user's hard default (survives gateway restarts) - /models switches the active model in memory (survives /new, session resets, and idle timeouts — clears only on gateway restart) - /model-status shows Default, Active (with source), Last Reply, and Cron This matches the original /model behavior where users could switch models without losing their configured default. Changes: - gateway/run.py: set_session_model/get_session_model/clear_session_model, _resolve_gateway_model checks override, _resolve_runtime_agent_kwargs checks override provider, _format_session_info shows override label, _handle_model_status_command shows Default + Active + Last Reply + Cron - discord.py: apply_selection uses set_session_model() instead of apply_model_selection() Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Defer interaction immediately before resolve_runtime_provider() to avoid Discord's 3-second timeout (Unknown interaction 10062 error) - Strip provider prefix from model ID (models.yaml uses "ollama-cloud/glm-5" but API expects "glm-5") — fixes 404 "model not found" and double-provider display in /model-status Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prevents "ollama-cloud/ollama-cloud/glm-5" when model ID from models.yaml already contains the provider prefix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The model picker was blindly stripping everything before the first "/" in model IDs, which breaks providers like Nous Portal (OpenRouter) where model IDs use vendor/model format (e.g. "google/gemini-3.1-pro-preview"). Now only strips the prefix when it matches the selected provider ID (e.g. "ollama-cloud/glm-5" → "glm-5" for ollama-cloud), preserving the full ID for providers that need it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
/models was sending the picker view without deferring first, causing Discord "Unknown interaction" errors when building the view took >3s. /model-status was routed through the full agent message pipeline (handle_message), which blocks behind any in-progress LLM call. Now responds directly by reading config/state inline — instant response. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Exposes the runner's effective model via module-level get/set functions (get_last_reply_model / set_last_reply_model) so the direct slash command handler can display which model actually responded and whether fallback was activated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
|
Related to #5742 (merged) which implemented an interactive model picker for Telegram and Discord. This PR adds Select menu UI and gateway-level override on top of that. |
Collaborator
|
Related to #5742 (merged) which implemented an interactive model picker for Telegram and Discord. |
Contributor
|
Thanks for the detailed picker implementation. This is now implemented on current
This is an automated hermes-sweeper review. |
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
Adds
/modelscommand with Discord Select menu UI and/model-statuscommand. Addresses #3710.New in latest commit: Gateway-level model override —
/modelsno longer writes to config.yaml. Instead, it sets an in-memory override that persists across/newand session resets, clearing only on gateway restart. This restores the session-scoped switching behavior that was lost when/modelwas removed in 9783c9d.How model switching works
/modelspick GLM-5/newor session resetConfig.yaml keeps the user's hard default. The picker switches the active model without touching it.
/model-statusoutputKey differences from #3718
/modelsdoes NOT write config.yaml/model-status— shows Default + Active + Last Reply + Cronmodels.yamlcatalog — user-curated per-provider model listsArchitecture
Files changed
gateway/platforms/discord.pygateway/run.pyset/get/clear_session_model(), model status, session info override labelhermes_cli/commands.pymodels,model-statushermes_cli/model_picker_config.pyTest plan
/modelsopens interactive picker with provider → model → reasoning dropdowns/newand session resets/model-statusshows Default, Active (with source), Last Reply, Cron🤖 Generated with Claude Code