fix(cli): cover future sonnet adaptive versions

Co-authored-by: kiloconnect[bot] <240665456+kiloconnect[bot]@users.noreply.github.com>
This commit is contained in:
chrarnoldus
2026-07-26 20:50:52 +00:00
parent a69a7cc5c4
commit 8aeff4856f
2 changed files with 16 additions and 7 deletions
+6 -6
View File
@@ -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({