Skip to content

Commit a0a123c

Browse files
committed
fix(registry): restore current kiro opus 4.7 catalog state
1 parent f1af29c commit a0a123c

6 files changed

Lines changed: 109 additions & 26 deletions

File tree

internal/config/oauth_model_alias_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ func TestSanitizeOAuthModelAlias_InjectsDefaultKiroAliases(t *testing.T) {
8282
"claude-sonnet-4-5",
8383
"claude-sonnet-4-20250514",
8484
"claude-sonnet-4",
85+
"claude-opus-4-7",
8586
"claude-opus-4-6",
8687
"claude-opus-4-5-20251101",
8788
"claude-opus-4-5",

internal/registry/model_definitions.go

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,18 @@ func GetKiroModels() []*ModelInfo {
643643
MaxCompletionTokens: 64000,
644644
Thinking: &ThinkingSupport{Min: 1024, Max: 32000, ZeroAllowed: true, DynamicAllowed: true},
645645
},
646+
{
647+
ID: "kiro-claude-opus-4-7",
648+
Object: "model",
649+
Created: 1746057600, // 2025-05-01
650+
OwnedBy: "aws",
651+
Type: "kiro",
652+
DisplayName: "Kiro Claude Opus 4.7",
653+
Description: "Claude Opus 4.7 via Kiro (2.2x credit)",
654+
ContextLength: 200000,
655+
MaxCompletionTokens: 64000,
656+
Thinking: &ThinkingSupport{Min: 1024, Max: 32000, ZeroAllowed: true, DynamicAllowed: true},
657+
},
646658
{
647659
ID: "kiro-claude-opus-4-6",
648660
Object: "model",
@@ -715,7 +727,7 @@ func GetKiroModels() []*ModelInfo {
715727
MaxCompletionTokens: 64000,
716728
Thinking: &ThinkingSupport{Min: 1024, Max: 32000, ZeroAllowed: true, DynamicAllowed: true},
717729
},
718-
// --- 第三方模型 (通过 Kiro 接入) ---
730+
// --- Third-party models routed through Kiro ---
719731
{
720732
ID: "kiro-deepseek-3-2",
721733
Object: "model",
@@ -797,6 +809,18 @@ func GetKiroModels() []*ModelInfo {
797809
MaxCompletionTokens: 4096,
798810
},
799811
// --- Agentic Variants (Optimized for coding agents with chunked writes) ---
812+
{
813+
ID: "kiro-claude-opus-4-7-agentic",
814+
Object: "model",
815+
Created: 1746057600, // 2025-05-01
816+
OwnedBy: "aws",
817+
Type: "kiro",
818+
DisplayName: "Kiro Claude Opus 4.7 (Agentic)",
819+
Description: "Claude Opus 4.7 optimized for coding agents (chunked writes)",
820+
ContextLength: 200000,
821+
MaxCompletionTokens: 64000,
822+
Thinking: &ThinkingSupport{Min: 1024, Max: 32000, ZeroAllowed: true, DynamicAllowed: true},
823+
},
800824
{
801825
ID: "kiro-claude-opus-4-6-agentic",
802826
Object: "model",

internal/registry/model_definitions_test.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,39 @@ func TestCodexStaticModelsIncludeGPT55(t *testing.T) {
3333
assertGPT55ModelInfo(t, "lookup", model)
3434
}
3535

36+
func TestKiroStaticModelsIncludeClaudeOpus47Variants(t *testing.T) {
37+
tests := []struct {
38+
id string
39+
displayName string
40+
}{
41+
{
42+
id: "kiro-claude-opus-4-7",
43+
displayName: "Kiro Claude Opus 4.7",
44+
},
45+
{
46+
id: "kiro-claude-opus-4-7-agentic",
47+
displayName: "Kiro Claude Opus 4.7 (Agentic)",
48+
},
49+
}
50+
51+
kiroModels := GetKiroModels()
52+
for _, tt := range tests {
53+
t.Run(tt.id, func(t *testing.T) {
54+
model := findModelInfo(kiroModels, tt.id)
55+
if model == nil {
56+
t.Fatalf("expected GetKiroModels to include %q", tt.id)
57+
}
58+
if model.DisplayName != tt.displayName {
59+
t.Fatalf("display name mismatch for %q: got %q, want %q", tt.id, model.DisplayName, tt.displayName)
60+
}
61+
lookup := LookupStaticModelInfo(tt.id)
62+
if lookup == nil {
63+
t.Fatalf("expected LookupStaticModelInfo to find %q", tt.id)
64+
}
65+
})
66+
}
67+
}
68+
3669
func findModelInfo(models []*ModelInfo, id string) *ModelInfo {
3770
for _, model := range models {
3871
if model != nil && model.ID == id {

internal/registry/models/models.json

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,29 +1293,6 @@
12931293
]
12941294
}
12951295
},
1296-
{
1297-
"id": "gpt-5.5",
1298-
"object": "model",
1299-
"created": 1776902400,
1300-
"owned_by": "openai",
1301-
"type": "openai",
1302-
"display_name": "GPT 5.5",
1303-
"version": "gpt-5.5",
1304-
"description": "Frontier model for complex coding, research, and real-world work.",
1305-
"context_length": 272000,
1306-
"max_completion_tokens": 128000,
1307-
"supported_parameters": [
1308-
"tools"
1309-
],
1310-
"thinking": {
1311-
"levels": [
1312-
"low",
1313-
"medium",
1314-
"high",
1315-
"xhigh"
1316-
]
1317-
}
1318-
},
13191296
{
13201297
"id": "codex-auto-review",
13211298
"object": "model",

internal/runtime/executor/antigravity_executor_credits_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ func TestEnsureAccessToken_WarmTokenLoadsCreditsHint(t *testing.T) {
400400
},
401401
}
402402
ctx := context.WithValue(context.Background(), "cliproxy.roundtripper", roundTripperFunc(func(req *http.Request) (*http.Response, error) {
403-
if req.URL.String() != "https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist" {
403+
if req.URL.String() != "https://daily-cloudcode-pa.googleapis.com/v1internal:loadCodeAssist" {
404404
t.Fatalf("unexpected request url %s", req.URL.String())
405405
}
406406
return &http.Response{
@@ -450,7 +450,7 @@ func TestUpdateAntigravityCreditsBalance_LoadCodeAssistUserAgent(t *testing.T) {
450450
Attributes: map[string]string{"user_agent": userAgent},
451451
}
452452
ctx := context.WithValue(context.Background(), "cliproxy.roundtripper", roundTripperFunc(func(req *http.Request) (*http.Response, error) {
453-
if req.URL.String() != "https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist" {
453+
if req.URL.String() != "https://daily-cloudcode-pa.googleapis.com/v1internal:loadCodeAssist" {
454454
t.Fatalf("unexpected request url %s", req.URL.String())
455455
}
456456
if got := req.Header.Get("User-Agent"); got != userAgent {

internal/runtime/executor/kiro_executor_test.go

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,3 +421,51 @@ func TestEndpointAliases(t *testing.T) {
421421
t.Errorf("unexpected number of aliases: got %d, want %d", len(endpointAliases), len(expectedAliases))
422422
}
423423
}
424+
425+
func TestMapModelToKiro_MapsClaudeOpus47Variants(t *testing.T) {
426+
executor := &KiroExecutor{}
427+
tests := []struct {
428+
name string
429+
model string
430+
expected string
431+
}{
432+
{
433+
name: "kiro alias",
434+
model: "kiro-claude-opus-4-7",
435+
expected: "claude-opus-4.7",
436+
},
437+
{
438+
name: "kiro agentic alias",
439+
model: "kiro-claude-opus-4-7-agentic",
440+
expected: "claude-opus-4.7",
441+
},
442+
{
443+
name: "native hyphen alias",
444+
model: "claude-opus-4-7",
445+
expected: "claude-opus-4.7",
446+
},
447+
{
448+
name: "native dotted alias",
449+
model: "claude-opus-4.7",
450+
expected: "claude-opus-4.7",
451+
},
452+
{
453+
name: "native agentic alias",
454+
model: "claude-opus-4.7-agentic",
455+
expected: "claude-opus-4.7",
456+
},
457+
{
458+
name: "unknown opus 4.7 fallback",
459+
model: "partner-opus-4.7-preview",
460+
expected: "claude-opus-4.7",
461+
},
462+
}
463+
464+
for _, tt := range tests {
465+
t.Run(tt.name, func(t *testing.T) {
466+
if got := executor.mapModelToKiro(tt.model); got != tt.expected {
467+
t.Fatalf("mapModelToKiro(%q) = %q, want %q", tt.model, got, tt.expected)
468+
}
469+
})
470+
}
471+
}

0 commit comments

Comments
 (0)