mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
fix(kiro): add Claude Sonnet 5 model support (#2264)
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
committed by
decolua
co-authored by
Cursor
parent
b08751c4ea
commit
a5363b83b5
@@ -1,6 +1,5 @@
|
||||
tests/unit/antigravity-mitm.test.js :: Antigravity MITM model handling flags the out-of-box agent/Default model mandatory
|
||||
tests/unit/claude-header-forwarding.test.js :: proxyAwareFetch — api.anthropic.com routing routes api.anthropic.com to gotScraping (non-streaming) and returns ok response
|
||||
tests/unit/kiro-model-slots.test.js :: Kiro MITM model slots offers a mappable slot for the agent default model id 'auto'
|
||||
tests/unit/oauth-cursor-auto-import.test.js :: GET /api/oauth/cursor/auto-import extracts tokens using exact keys
|
||||
tests/unit/oauth-cursor-auto-import.test.js :: GET /api/oauth/cursor/auto-import falls back to fuzzy key matching on macOS when exact keys are missing
|
||||
tests/unit/oauth-cursor-auto-import.test.js :: GET /api/oauth/cursor/auto-import linux uses single hardcoded path and original error message
|
||||
@@ -23,4 +22,4 @@ tests/unit/rtk.test.js :: compressMessages (enabled) skips when body has no mess
|
||||
tests/unit/translator-request-normalization.test.js :: request normalization claudeToOpenAIRequest flattens text-only content arrays into string
|
||||
tests/unit/translator-request-normalization.test.js :: request normalization filterToOpenAIFormat flattens text-only arrays to string
|
||||
tests/unit/translator-request-normalization.test.js :: request normalization parseSSELine supports provider raw NDJSON stream lines
|
||||
tests/unit/translator-request-normalization.test.js :: request normalization translateRequest keeps /v1/messages Claude->OpenAI text payloads string-safe
|
||||
tests/unit/translator-request-normalization.test.js :: request normalization translateRequest keeps /v1/messages Claude->OpenAI text payloads string-safe
|
||||
|
||||
@@ -2,6 +2,15 @@ import { describe, expect, it } from "vitest";
|
||||
import { getCapabilitiesForModel } from "../../open-sse/providers/capabilities.js";
|
||||
|
||||
describe("getCapabilitiesForModel", () => {
|
||||
const claudeSonnet5Expected = {
|
||||
contextWindow: 1000000,
|
||||
maxOutput: 128000,
|
||||
thinkingFormat: "claude-adaptive",
|
||||
reasoning: true,
|
||||
vision: true,
|
||||
search: true,
|
||||
};
|
||||
|
||||
it("reports Kiro Claude Opus 4.8 as a 1M context model", () => {
|
||||
expect(getCapabilitiesForModel("kiro", "claude-opus-4.8").contextWindow).toBe(1000000);
|
||||
expect(getCapabilitiesForModel("kiro", "anthropic/claude-opus-4.8").contextWindow).toBe(1000000);
|
||||
@@ -9,4 +18,12 @@ describe("getCapabilitiesForModel", () => {
|
||||
expect(getCapabilitiesForModel("kiro", "claude-opus-4.8-thinking").contextWindow).toBe(1000000);
|
||||
expect(getCapabilitiesForModel("kiro", "claude-opus-4-8-thinking").contextWindow).toBe(1000000);
|
||||
});
|
||||
|
||||
it("reports Kiro Claude Sonnet 5 as a 1M adaptive-thinking model", () => {
|
||||
expect(getCapabilitiesForModel("kiro", "claude-sonnet-5")).toMatchObject(claudeSonnet5Expected);
|
||||
expect(getCapabilitiesForModel("kiro", "anthropic/claude-sonnet-5")).toMatchObject(claudeSonnet5Expected);
|
||||
expect(getCapabilitiesForModel("kiro", "claude-sonnet-5-thinking")).toMatchObject(claudeSonnet5Expected);
|
||||
expect(getCapabilitiesForModel("kiro", "claude-sonnet-5-agentic")).toMatchObject(claudeSonnet5Expected);
|
||||
expect(getCapabilitiesForModel("kiro", "claude-sonnet-5-thinking-agentic")).toMatchObject(claudeSonnet5Expected);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { PROVIDER_MODELS } from "../../open-sse/config/providerModels.js";
|
||||
import { MITM_TOOLS } from "../../src/shared/constants/cliTools.js";
|
||||
|
||||
// Guards the fix in commit 356607c: Kiro's agent/"vibe" mode sends modelId
|
||||
// "auto" for the main turn and "simple-task" for background sub-tasks. Both
|
||||
// need a mappable defaultModels slot — otherwise getMappedModel (src/mitm/server.js)
|
||||
// returns null and the /generateAssistantResponse call is passed through to AWS
|
||||
// instead of being routed to the user's chosen provider (surfacing as Kiro's
|
||||
// "monthly usage limit" once the AWS quota is gone).
|
||||
// Guards Kiro model ids that still need mappable defaultModels slots. Without
|
||||
// a slot, getMappedModel (src/mitm/server.js) returns null and the request is
|
||||
// passed through to AWS instead of being routed to the user's chosen provider.
|
||||
describe("Kiro MITM model slots", () => {
|
||||
const kiro = MITM_TOOLS.kiro;
|
||||
|
||||
@@ -16,10 +14,10 @@ describe("Kiro MITM model slots", () => {
|
||||
expect(Array.isArray(kiro.defaultModels)).toBe(true);
|
||||
});
|
||||
|
||||
it("offers a mappable slot for the agent default model id 'auto'", () => {
|
||||
const auto = kiro.defaultModels.find((m) => m.id === "auto");
|
||||
expect(auto).toBeTruthy();
|
||||
expect(auto.alias).toBe("auto");
|
||||
it("offers a mappable slot for Claude Sonnet 5", () => {
|
||||
const sonnet5 = kiro.defaultModels.find((m) => m.id === "claude-sonnet-5");
|
||||
expect(sonnet5).toBeTruthy();
|
||||
expect(sonnet5.alias).toBe("claude-sonnet-5");
|
||||
});
|
||||
|
||||
it("offers a mappable slot for the background sub-task model id 'simple-task'", () => {
|
||||
@@ -28,3 +26,15 @@ describe("Kiro MITM model slots", () => {
|
||||
expect(simpleTask.alias).toBe("simple-task");
|
||||
});
|
||||
});
|
||||
|
||||
describe("Kiro static provider models", () => {
|
||||
it("includes Claude Sonnet 5 and its synthetic Kiro variants", () => {
|
||||
const ids = (PROVIDER_MODELS.kr || []).map((model) => model.id);
|
||||
expect(ids).toEqual(expect.arrayContaining([
|
||||
"claude-sonnet-5",
|
||||
"claude-sonnet-5-thinking",
|
||||
"claude-sonnet-5-agentic",
|
||||
"claude-sonnet-5-thinking-agentic",
|
||||
]));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user