fix: Store model aliases instead of hardcoded model IDs
The /model command was mapping aliases (sonnet, opus, haiku) to specific model IDs (claude-sonnet-4-5, etc) and saving those to config. This prevented automatic adoption of newer model versions. Claude CLI already resolves aliases to the latest version, so just store the alias directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
48c93adade
commit
01320c0400
@ -262,24 +262,11 @@ class ClaudeCommands(commands.Cog):
|
||||
ephemeral=True
|
||||
)
|
||||
return
|
||||
|
||||
# Map model names to Claude CLI model identifiers
|
||||
model_mapping = {
|
||||
"sonnet": "claude-sonnet-4-5",
|
||||
"opus": "claude-opus-4-6",
|
||||
"haiku": "claude-3-5-haiku"
|
||||
}
|
||||
|
||||
if model_name not in model_mapping:
|
||||
await interaction.response.send_message(
|
||||
f"❌ Invalid model: {model_name}. Use: sonnet, opus, or haiku",
|
||||
ephemeral=True
|
||||
)
|
||||
return
|
||||
|
||||
|
||||
# Update project config with new model
|
||||
# Store the alias (sonnet/opus/haiku) - Claude CLI resolves to latest version
|
||||
old_model = project.model
|
||||
project.model = model_mapping[model_name]
|
||||
project.model = model_name
|
||||
|
||||
# Save configuration
|
||||
self.config.save()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user