mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
Merge pull request #11906 from Kilo-Org/christiaan/claude-adaptive
Add Fable and Sonnet 5 as adaptive reasoning models
This commit is contained in:
@@ -119,6 +119,106 @@ describe("ProviderTransform.variants - Claude Opus 4.7 / 4.8", () => {
|
||||
})
|
||||
})
|
||||
|
||||
test("fable returns adaptive thinking variants including xhigh (native anthropic)", () => {
|
||||
const model = mockModel({
|
||||
api: {
|
||||
id: "claude-fable-5",
|
||||
url: "https://api.anthropic.com",
|
||||
npm: "@ai-sdk/anthropic",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh", "max"])
|
||||
expect(result.xhigh).toEqual({
|
||||
thinking: { type: "adaptive", display: "summarized" },
|
||||
effort: "xhigh",
|
||||
})
|
||||
})
|
||||
|
||||
test("fable returns adaptive thinking variants via @ai-sdk/gateway", () => {
|
||||
const model = mockModel({
|
||||
id: "anthropic/claude-fable-5",
|
||||
api: {
|
||||
id: "anthropic/claude-fable-5",
|
||||
url: "https://gateway.ai",
|
||||
npm: "@ai-sdk/gateway",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh", "max"])
|
||||
})
|
||||
|
||||
test("fable on bedrock returns adaptive reasoningConfig with xhigh", () => {
|
||||
const model = mockModel({
|
||||
api: {
|
||||
id: "anthropic.claude-fable-5",
|
||||
url: "https://bedrock.amazonaws.com",
|
||||
npm: "@ai-sdk/amazon-bedrock",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh", "max"])
|
||||
expect(result.xhigh).toEqual({
|
||||
reasoningConfig: { type: "adaptive", maxReasoningEffort: "xhigh", display: "summarized" },
|
||||
})
|
||||
})
|
||||
|
||||
test("sonnet-5 returns adaptive thinking variants including xhigh (native anthropic)", () => {
|
||||
const model = mockModel({
|
||||
api: {
|
||||
id: "claude-sonnet-5",
|
||||
url: "https://api.anthropic.com",
|
||||
npm: "@ai-sdk/anthropic",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh", "max"])
|
||||
expect(result.xhigh).toEqual({
|
||||
thinking: { type: "adaptive", display: "summarized" },
|
||||
effort: "xhigh",
|
||||
})
|
||||
})
|
||||
|
||||
test("sonnet-5 returns adaptive thinking variants via @ai-sdk/gateway", () => {
|
||||
const model = mockModel({
|
||||
id: "anthropic/claude-sonnet-5",
|
||||
api: {
|
||||
id: "anthropic/claude-sonnet-5",
|
||||
url: "https://gateway.ai",
|
||||
npm: "@ai-sdk/gateway",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh", "max"])
|
||||
})
|
||||
|
||||
test("sonnet-5 on bedrock returns adaptive reasoningConfig with xhigh", () => {
|
||||
const model = mockModel({
|
||||
api: {
|
||||
id: "anthropic.claude-sonnet-5",
|
||||
url: "https://bedrock.amazonaws.com",
|
||||
npm: "@ai-sdk/amazon-bedrock",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh", "max"])
|
||||
expect(result.xhigh).toEqual({
|
||||
reasoningConfig: { type: "adaptive", maxReasoningEffort: "xhigh", display: "summarized" },
|
||||
})
|
||||
})
|
||||
|
||||
test("sonnet-4.6 keeps original adaptive efforts without xhigh", () => {
|
||||
const model = mockModel({
|
||||
api: {
|
||||
id: "claude-sonnet-4.6",
|
||||
url: "https://api.anthropic.com",
|
||||
npm: "@ai-sdk/anthropic",
|
||||
},
|
||||
})
|
||||
const result = ProviderTransform.variants(model)
|
||||
expect(Object.keys(result)).toEqual(["low", "medium", "high", "max"])
|
||||
})
|
||||
|
||||
test("opus-4-6 keeps original adaptive efforts without xhigh", () => {
|
||||
const model = mockModel({
|
||||
api: {
|
||||
|
||||
Reference in New Issue
Block a user