feat: runtime model switching via /model command#160
Open
Talla wants to merge 2 commits intoRichardAtCT:mainfrom
Open
feat: runtime model switching via /model command#160Talla wants to merge 2 commits intoRichardAtCT:mainfrom
Talla wants to merge 2 commits intoRichardAtCT:mainfrom
Conversation
Add /model command with inline keyboard UI for switching between Opus/Sonnet/Haiku models and effort levels (low/medium/high/max) at runtime. Model changes force a new session since the CLI doesn't support model switching on resumed sessions. - Effort levels are model-aware: Haiku has none, Sonnet excludes "max", Opus supports all including "max" - Override is per-user via context.user_data (in-memory, resets on bot restart) - Threaded through all run_command call sites (orchestrator, classic message handler) into the SDK layer - Registered in both agentic and classic handler modes - Added to bot command menu and /help text - 17 new tests covering keyboard display, model/effort selection, label formatting, and effort-per-model configuration Closes RichardAtCT#138
Instead of just "Default", show "Default (claude-sonnet-4-6)" or "Default (CLI default)" so users can verify what model is active after resetting.
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 a
/modelcommand that lets users switch between Claude models (Opus, Sonnet, Haiku) and set effort levels at runtime via an inline keyboard UI — no bot restart or config changes needed./model→ pick model → pick effort level (if supported) → donecontext.user_data(in-memory). Resets on bot restart — server default (CLAUDE_MODELenv var) is used until the user overrides.Implements the feature requested in #138.
Changes
command.py/modelcommand,model_callback,_handle_model_selectionshared logic, model/effort constantscallback.pymodel:andeffort:callbacks in classic modeorchestrator.pyrun_commandmessage.pymodel_override+effort_overridethrough all 4 classicrun_commandcall sitesfacade.pymodel_override+effort_overrideparamssdk_integration.pymodel_overrideandefforttoClaudeAgentOptionstest_model_command.pytest_orchestrator.pyTest plan
/modelshows keyboard with Opus/Sonnet/Haiku + ResetCloses #138
🤖 Generated with Claude Code