mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-21 05:52:35 +08:00
fix(cli): annotate opus 4.8 changes and use array-form id checks
This commit is contained in:
@@ -125,9 +125,11 @@ function build(key: string, remote: Item, url: string, prev?: Model): Model {
|
||||
variants[effort] = {
|
||||
thinking: {
|
||||
type: "adaptive",
|
||||
...(model.api.id.includes("opus-4.7") || model.api.id.includes("opus-4.8")
|
||||
// kilocode_change start - treat opus-4.8 like opus-4.7
|
||||
...(["opus-4-7", "opus-4.7", "opus-4-8", "opus-4.8"].some((v) => model.api.id.includes(v))
|
||||
? { display: "summarized" }
|
||||
: {}), // kilocode_change - treat opus-4.8 like opus-4.7
|
||||
: {}),
|
||||
// kilocode_change end
|
||||
},
|
||||
effort,
|
||||
}
|
||||
|
||||
@@ -542,10 +542,11 @@ function openaiReasoningEfforts(apiId: string, releaseDate: string): string[] |
|
||||
}
|
||||
|
||||
function anthropicAdaptiveEfforts(apiId: string): string[] | null {
|
||||
// kilocode_change start - treat opus-4.8 like opus-4.7
|
||||
if (["opus-4-7", "opus-4.7", "opus-4-8", "opus-4.8"].some((v) => apiId.includes(v))) {
|
||||
// kilocode_change - treat opus-4.8 like opus-4.7
|
||||
return ["low", "medium", "high", "xhigh", "max"]
|
||||
}
|
||||
// kilocode_change end
|
||||
if (["opus-4-6", "opus-4.6", "sonnet-4-6", "sonnet-4.6"].some((v) => apiId.includes(v))) {
|
||||
return ["low", "medium", "high", "max"]
|
||||
}
|
||||
@@ -781,10 +782,11 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
|
||||
if (adaptiveEfforts) {
|
||||
let efforts = [...adaptiveEfforts]
|
||||
if (model.providerID === "github-copilot") {
|
||||
if (model.api.id.includes("opus-4.7") || model.api.id.includes("opus-4.8")) {
|
||||
// kilocode_change - treat opus-4.8 like opus-4.7
|
||||
// kilocode_change start - treat opus-4.8 like opus-4.7
|
||||
if (["opus-4-7", "opus-4.7", "opus-4-8", "opus-4.8"].some((v) => model.api.id.includes(v))) {
|
||||
efforts = ["medium"]
|
||||
}
|
||||
// kilocode_change end
|
||||
// Efforts currently supported are: low, medium, high
|
||||
efforts = efforts.filter((v) => v !== "max" && v !== "xhigh")
|
||||
}
|
||||
@@ -794,10 +796,11 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
|
||||
{
|
||||
thinking: {
|
||||
type: "adaptive",
|
||||
// kilocode_change - treat opus-4.8 like opus-4.7
|
||||
// kilocode_change start - treat opus-4.8 like opus-4.7
|
||||
...(["opus-4-7", "opus-4.7", "opus-4-8", "opus-4.8"].some((v) => model.api.id.includes(v))
|
||||
? { display: "summarized" }
|
||||
: {}),
|
||||
// kilocode_change end
|
||||
},
|
||||
effort,
|
||||
},
|
||||
@@ -830,10 +833,11 @@ export function variants(model: Provider.Model): Record<string, Record<string, a
|
||||
reasoningConfig: {
|
||||
type: "adaptive",
|
||||
maxReasoningEffort: effort,
|
||||
// kilocode_change - treat opus-4.8 like opus-4.7
|
||||
// kilocode_change start - treat opus-4.8 like opus-4.7
|
||||
...(["opus-4-7", "opus-4.7", "opus-4-8", "opus-4.8"].some((v) => model.api.id.includes(v))
|
||||
? { display: "summarized" }
|
||||
: {}),
|
||||
// kilocode_change end
|
||||
},
|
||||
},
|
||||
]),
|
||||
|
||||
@@ -30,7 +30,7 @@ function mockModel(overrides: Partial<any> = {}): any {
|
||||
}
|
||||
}
|
||||
|
||||
describe("ProviderTransform.variants - Claude Opus 4.7", () => {
|
||||
describe("ProviderTransform.variants - Claude Opus 4.7 / 4.8", () => {
|
||||
test("opus-4-7 returns adaptive thinking variants including xhigh (native anthropic)", () => {
|
||||
const model = mockModel({
|
||||
api: {
|
||||
|
||||
Reference in New Issue
Block a user