Skip to content

Commit 2634077

Browse files
Ethan Parkclaude
andcommitted
fix: use correct Claude API model IDs (without date suffix)
The official API model IDs are 'claude-opus-4-6' and 'claude-sonnet-4-6' without date suffixes. The previous '-20260301' suffix caused model not found errors. Verified working with actual Claude Agent SDK query. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3c00d5b commit 2634077

3 files changed

Lines changed: 15 additions & 16 deletions

File tree

lib/constants/claudeModels.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export type ClaudeModelId =
2-
| 'claude-opus-4-6-20260301'
3-
| 'claude-sonnet-4-6-20260301'
2+
| 'claude-opus-4-6'
3+
| 'claude-sonnet-4-6'
44
| 'claude-haiku-4-5-20251001';
55

66
export interface ClaudeModelDefinition {
@@ -17,22 +17,23 @@ export interface ClaudeModelDefinition {
1717

1818
export const CLAUDE_MODEL_DEFINITIONS: ClaudeModelDefinition[] = [
1919
{
20-
id: 'claude-opus-4-6-20260301',
20+
id: 'claude-opus-4-6',
2121
name: 'Claude Opus 4.6',
22-
description: 'Newest Opus release with the strongest reasoning skills',
22+
description: 'The most intelligent model for building agents and coding',
2323
supportsImages: true,
2424
aliases: [
25-
'claude-opus-4-6-20260301',
2625
'claude-opus-4-6',
2726
'claude-opus-4.6',
2827
'claude-opus-4',
2928
'claude-opus',
30-
'opus-4-6-20260301',
3129
'opus-4-6',
3230
'opus-4.6',
3331
'opus-4',
3432
'opus',
3533
// Legacy aliases
34+
'claude-opus-4-5-20251101',
35+
'claude-opus-4-5',
36+
'claude-opus-4.5',
3637
'claude-opus-4-1-20250805',
3738
'claude-opus-4-1',
3839
'claude-opus-4.1',
@@ -42,17 +43,15 @@ export const CLAUDE_MODEL_DEFINITIONS: ClaudeModelDefinition[] = [
4243
],
4344
},
4445
{
45-
id: 'claude-sonnet-4-6-20260301',
46+
id: 'claude-sonnet-4-6',
4647
name: 'Claude Sonnet 4.6',
47-
description: 'Balanced Sonnet tier with a large context window',
48+
description: 'The best combination of speed and intelligence',
4849
supportsImages: true,
4950
aliases: [
50-
'claude-sonnet-4-6-20260301',
5151
'claude-sonnet-4-6',
5252
'claude-sonnet-4.6',
5353
'claude-sonnet-4',
5454
'claude-sonnet',
55-
'sonnet-4-6-20260301',
5655
'sonnet-4-6',
5756
'sonnet-4.6',
5857
'sonnet-4',
@@ -70,7 +69,7 @@ export const CLAUDE_MODEL_DEFINITIONS: ClaudeModelDefinition[] = [
7069
{
7170
id: 'claude-haiku-4-5-20251001',
7271
name: 'Claude Haiku 4.5',
73-
description: 'Fastest Haiku tier for lightweight tasks',
72+
description: 'The fastest model with near-frontier intelligence',
7473
supportsImages: true,
7574
aliases: [
7675
'claude-haiku-4-5-20251001',
@@ -91,7 +90,7 @@ export const CLAUDE_MODEL_DEFINITIONS: ClaudeModelDefinition[] = [
9190
},
9291
];
9392

94-
export const CLAUDE_DEFAULT_MODEL: ClaudeModelId = 'claude-sonnet-4-6-20260301';
93+
export const CLAUDE_DEFAULT_MODEL: ClaudeModelId = 'claude-sonnet-4-6';
9594

9695
const CLAUDE_MODEL_ALIAS_MAP: Record<string, ClaudeModelId> = CLAUDE_MODEL_DEFINITIONS.reduce(
9796
(map, definition) => {

lib/services/cli/claude.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ function resolveModelId(model?: string | null): string {
556556
* @param projectId - Project ID
557557
* @param projectPath - Project directory path
558558
* @param instruction - Command to pass to AI
559-
* @param model - Claude model to use (default: claude-sonnet-4-6-20260301)
559+
* @param model - Claude model to use (default: claude-sonnet-4-6)
560560
* @param sessionId - Previous session ID (maintains conversation context)
561561
* @param requestId - (Optional) User request tracking ID
562562
*/
@@ -1150,7 +1150,7 @@ export async function executeClaude(
11501150
* @param projectId - Project ID
11511151
* @param projectPath - Project directory path
11521152
* @param initialPrompt - Initial prompt
1153-
* @param model - Claude model to use (default: claude-sonnet-4-6-20260301)
1153+
* @param model - Claude model to use (default: claude-sonnet-4-6)
11541154
* @param requestId - (Optional) User request tracking ID
11551155
*/
11561156
export async function initializeNextJsProject(
@@ -1180,7 +1180,7 @@ Set up the basic project structure and implement the requested features.
11801180
* @param projectId - Project ID
11811181
* @param projectPath - Project directory path
11821182
* @param instruction - Change request command
1183-
* @param model - Claude model to use (default: claude-sonnet-4-6-20260301)
1183+
* @param model - Claude model to use (default: claude-sonnet-4-6)
11841184
* @param sessionId - Session ID
11851185
* @param requestId - (Optional) User request tracking ID
11861186
*/

prisma/schema.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ model Project {
3737
3838
// CLI Preferences
3939
preferredCli String? @map("preferred_cli") // claude, cursor, codex, gemini, qwen
40-
selectedModel String? @map("selected_model") // claude model id (claude-opus-4-6-20260301 | claude-sonnet-4-6-20260301 | claude-haiku-4-5-20251001)
40+
selectedModel String? @map("selected_model") // claude model id (claude-opus-4-6 | claude-sonnet-4-6 | claude-haiku-4-5-20251001)
4141
fallbackEnabled Boolean @default(false) @map("fallback_enabled")
4242
4343
// Settings (JSON)

0 commit comments

Comments
 (0)