diff --git a/packages/opencode/src/plugin/github-copilot/models.ts b/packages/opencode/src/plugin/github-copilot/models.ts index e2524288b72..7f666b0cfbc 100644 --- a/packages/opencode/src/plugin/github-copilot/models.ts +++ b/packages/opencode/src/plugin/github-copilot/models.ts @@ -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, } diff --git a/packages/opencode/src/provider/transform.ts b/packages/opencode/src/provider/transform.ts index c90ad794087..640aadbb157 100644 --- a/packages/opencode/src/provider/transform.ts +++ b/packages/opencode/src/provider/transform.ts @@ -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 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 model.api.id.includes(v)) ? { display: "summarized" } : {}), + // kilocode_change end }, effort, }, @@ -830,10 +833,11 @@ export function variants(model: Provider.Model): Record model.api.id.includes(v)) ? { display: "summarized" } : {}), + // kilocode_change end }, }, ]), diff --git a/packages/opencode/test/kilocode/transform-opus-4.7.test.ts b/packages/opencode/test/kilocode/transform-opus-4.7.test.ts index 59584a44a1a..af26d4163f8 100644 --- a/packages/opencode/test/kilocode/transform-opus-4.7.test.ts +++ b/packages/opencode/test/kilocode/transform-opus-4.7.test.ts @@ -30,7 +30,7 @@ function mockModel(overrides: Partial = {}): 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: {