mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-01 15:32:11 +08:00
fix(cli): cover future sonnet adaptive versions
Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
This commit is contained in:
@@ -616,17 +616,17 @@ function anthropicOpus47OrLater(apiId: string) {
|
||||
return major > 4 || (major === 4 && minor >= 7)
|
||||
}
|
||||
|
||||
// kilocode_change start - Claude 5 aliases and Opus 5+ are adaptive thinking models like opus-4.7/4.8
|
||||
// kilocode_change start - Claude 5+ models are adaptive thinking models like opus-4.7/4.8
|
||||
function anthropicClaude5(apiId: string) {
|
||||
const id = apiId.toLowerCase()
|
||||
if (id.includes("fable") || /sonnet[.-]5/.test(id)) return true
|
||||
const opus = /opus[.-](\d+)(?:[.@-]|$)|claude-(\d+)(?:[.-]\d+)?-opus(?:[.@-]|$)/.exec(id)
|
||||
return Number(opus?.[1] ?? opus?.[2]) >= 5
|
||||
if (id.includes("fable")) return true
|
||||
const version = /(?:opus|sonnet)[.-](\d+)(?:[.@-]|$)|claude-(\d+)(?:[.-]\d+)?-(?:opus|sonnet)(?:[.@-]|$)/.exec(id)
|
||||
return Number(version?.[1] ?? version?.[2]) >= 5
|
||||
}
|
||||
// kilocode_change end
|
||||
|
||||
function anthropicAdaptiveEfforts(apiId: string): string[] | null {
|
||||
// kilocode_change start - include Claude 5 aliases and future Opus versions
|
||||
// kilocode_change start - include Claude 5+ models
|
||||
if (anthropicOpus47OrLater(apiId) || anthropicClaude5(apiId)) {
|
||||
return ["low", "medium", "high", "xhigh", "max"]
|
||||
}
|
||||
@@ -979,7 +979,7 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
|
||||
if (adaptiveEfforts) {
|
||||
let efforts = [...adaptiveEfforts]
|
||||
if (model.providerID === "github-copilot") {
|
||||
// kilocode_change start - include Claude 5 aliases and future Opus versions
|
||||
// kilocode_change start - include Claude 5+ models
|
||||
if (
|
||||
model.api.id.includes("opus-4.7") ||
|
||||
model.api.id.includes("opus-4.8") ||
|
||||
|
||||
@@ -251,7 +251,16 @@ describe("ProviderTransform.variants - Claude Opus 4.7 / 4.8", () => {
|
||||
})
|
||||
})
|
||||
|
||||
test.each(["claude-opus-5.3", "claude-opus-6", "claude-6-opus", "claude-opus-10"])(
|
||||
test.each([
|
||||
"claude-opus-5.3",
|
||||
"claude-opus-6",
|
||||
"claude-6-opus",
|
||||
"claude-opus-10",
|
||||
"claude-sonnet-5.3",
|
||||
"claude-sonnet-6",
|
||||
"claude-6-sonnet",
|
||||
"claude-sonnet-10",
|
||||
])(
|
||||
"%s is treated as an adaptive thinking model",
|
||||
(id) => {
|
||||
const model = mockModel({
|
||||
|
||||
Reference in New Issue
Block a user