Skip to content

Commit ed40eb1

Browse files
authored
Merge pull request #43 from Bin-Huang/fix/anthropic-model-id-format
fix(models): use dash-separated Anthropic model IDs
2 parents d4b7a63 + 4e24fb9 commit ed40eb1

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

internal/scope/fallback_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ func TestSettingPrecedence_AgentBeatsUserBeatsSystem(t *testing.T) {
5050

5151
// agent-scope override on top
5252
if err := SaveSetting(ctx, db, "", agentID, "agents.defaults",
53-
map[string]interface{}{"model": "anthropic/claude-opus-4.7"}); err != nil {
53+
map[string]interface{}{"model": "anthropic/claude-opus-4-7"}); err != nil {
5454
t.Fatalf("save agent: %v", err)
5555
}
5656
got = config.AgentDefaults{}
5757
if err := SettingInto(ctx, db, "agents.defaults", userID, agentID, &got); err != nil {
5858
t.Fatalf("setting into: %v", err)
5959
}
60-
if got.Model != "anthropic/claude-opus-4.7" {
61-
t.Fatalf("agent should beat user: want anthropic/claude-opus-4.7, got %q", got.Model)
60+
if got.Model != "anthropic/claude-opus-4-7" {
61+
t.Fatalf("agent should beat user: want anthropic/claude-opus-4-7, got %q", got.Model)
6262
}
6363

6464
// Verify the raw agent-scope row reads what we wrote, independent of
@@ -72,8 +72,8 @@ func TestSettingPrecedence_AgentBeatsUserBeatsSystem(t *testing.T) {
7272
if rec == nil {
7373
t.Fatal("agent-scope row missing after save")
7474
}
75-
if v, _ := rec.Data["model"].(string); v != "anthropic/claude-opus-4.7" {
76-
t.Fatalf("agent-scope row model: want anthropic/claude-opus-4.7, got %q", v)
75+
if v, _ := rec.Data["model"].(string); v != "anthropic/claude-opus-4-7" {
76+
t.Fatalf("agent-scope row model: want anthropic/claude-opus-4-7, got %q", v)
7777
}
7878

7979
// Delete agent-scope (empty data) → falls back to user-scope.

web/src/app/agents/[id]/models/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const PROVIDER_PRESETS: Record<
6666
> = {
6767
openai: { apiBase: "https://api.openai.com/v1", apiType: "openai-chat", authType: "bearer-token", models: ["gpt-5.5"] },
6868
openrouter: { apiBase: "https://openrouter.ai/api/v1", apiType: "openai-chat", authType: "bearer-token", models: [] },
69-
anthropic: { apiBase: "https://api.anthropic.com", apiType: "anthropic-messages", authType: "api-key", models: ["claude-opus-4.7", "claude-sonnet-4.7", "claude-haiku-4.5"] },
69+
anthropic: { apiBase: "https://api.anthropic.com", apiType: "anthropic-messages", authType: "api-key", models: ["claude-opus-4-7", "claude-sonnet-4-7", "claude-haiku-4-5"] },
7070
deepseek: { apiBase: "https://api.deepseek.com", apiType: "openai-chat", authType: "bearer-token", models: ["deepseek-v4-pro", "deepseek-v4-flash"] },
7171
ollama: { apiBase: "http://localhost:11434/v1", apiType: "openai-chat", authType: "bearer-token", models: [] },
7272
custom: { apiBase: "", apiType: "openai-chat", authType: "bearer-token", models: [] },

web/src/app/models/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const PROVIDER_PRESETS: Record<
5959
> = {
6060
openai: { apiBase: "https://api.openai.com/v1", apiType: "openai-chat", authType: "bearer-token", models: ["gpt-5.5"] },
6161
openrouter: { apiBase: "https://openrouter.ai/api/v1", apiType: "openai-chat", authType: "bearer-token", models: [] },
62-
anthropic: { apiBase: "https://api.anthropic.com", apiType: "anthropic-messages", authType: "api-key", models: ["claude-opus-4.7", "claude-sonnet-4.7", "claude-haiku-4.5"] },
62+
anthropic: { apiBase: "https://api.anthropic.com", apiType: "anthropic-messages", authType: "api-key", models: ["claude-opus-4-7", "claude-sonnet-4-7", "claude-haiku-4-5"] },
6363
deepseek: { apiBase: "https://api.deepseek.com", apiType: "openai-chat", authType: "bearer-token", models: ["deepseek-v4-pro", "deepseek-v4-flash"] },
6464
ollama: { apiBase: "http://localhost:11434/v1", apiType: "openai-chat", authType: "bearer-token", models: [] },
6565
custom: { apiBase: "", apiType: "openai-chat", authType: "bearer-token", models: [] },

web/src/app/onboard/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ const PROVIDERS: Record<
9494
apiBase: "https://api.anthropic.com",
9595
apiType: "anthropic-messages",
9696
authType: "api-key",
97-
models: ["claude-opus-4.7", "claude-sonnet-4.7", "claude-haiku-4.5"],
97+
models: ["claude-opus-4-7", "claude-sonnet-4-7", "claude-haiku-4-5"],
9898
},
9999
deepseek: {
100100
apiBase: "https://api.deepseek.com",

0 commit comments

Comments
 (0)