feat(claudecode): add opus[1m] model option and use shorthand descs (#660)

- Add opus[1m] to the default model fallback list (Claude Opus 1M context)
- Drop version numbers from Sonnet/Opus/Haiku descs so they auto-follow
  upstream version bumps (4 -> 4.6/4.7 -> future) without code churn
- Skip sonnet[1m] (needs extra usage) and haiku[1m] (subscription has no
  permission) since the CLI accepts the syntax but usage is gated

Co-authored-by: 张彧 <aaron@mac.tail449498.ts.net>
This commit is contained in:
Yu Zhangand张彧 authored and GitHub committed 2026-04-24 06:31:31 +08:00
1 parent 6e0a2e116e
commit ccb0e366a8
1 file changed
+4 -3
+4 -3
View File
@@ -302,9 +302,10 @@ func (a *Agent) AvailableModels(ctx context.Context) []core.ModelOption {
return models
}
return []core.ModelOption{
{Name: "sonnet", Desc: "Claude Sonnet 4 (balanced)"},
{Name: "opus", Desc: "Claude Opus 4 (most capable)"},
{Name: "haiku", Desc: "Claude Haiku 3.5 (fastest)"},
{Name: "sonnet", Desc: "Claude Sonnet (balanced)"},
{Name: "opus", Desc: "Claude Opus (most capable)"},
{Name: "opus[1m]", Desc: "Claude Opus (1M context)"},
{Name: "haiku", Desc: "Claude Haiku (fastest)"},
}
}