Skip to content

Commit 5838b58

Browse files
add copilot gpt-5.4 xhigh support (anomalyco#16294)
1 parent 2712244 commit 5838b58

2 files changed

Lines changed: 32 additions & 1 deletion

File tree

packages/opencode/src/provider/transform.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,9 @@ export namespace ProviderTransform {
440440
const copilotEfforts = iife(() => {
441441
if (id.includes("5.1-codex-max") || id.includes("5.2") || id.includes("5.3"))
442442
return [...WIDELY_SUPPORTED_EFFORTS, "xhigh"]
443-
return WIDELY_SUPPORTED_EFFORTS
443+
const arr = [...WIDELY_SUPPORTED_EFFORTS]
444+
if (id.includes("gpt-5") && model.release_date >= "2025-12-04") arr.push("xhigh")
445+
return arr
444446
})
445447
return Object.fromEntries(
446448
copilotEfforts.map((effort) => [

packages/opencode/test/provider/transform.test.ts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2002,6 +2002,35 @@ describe("ProviderTransform.variants", () => {
20022002
const result = ProviderTransform.variants(model)
20032003
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh"])
20042004
})
2005+
2006+
test("gpt-5.3-codex includes xhigh", () => {
2007+
const model = createMockModel({
2008+
id: "gpt-5.3-codex",
2009+
providerID: "github-copilot",
2010+
api: {
2011+
id: "gpt-5.3-codex",
2012+
url: "https://api.githubcopilot.com",
2013+
npm: "@ai-sdk/github-copilot",
2014+
},
2015+
})
2016+
const result = ProviderTransform.variants(model)
2017+
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh"])
2018+
})
2019+
2020+
test("gpt-5.4 includes xhigh", () => {
2021+
const model = createMockModel({
2022+
id: "gpt-5.4",
2023+
release_date: "2026-03-05",
2024+
providerID: "github-copilot",
2025+
api: {
2026+
id: "gpt-5.4",
2027+
url: "https://api.githubcopilot.com",
2028+
npm: "@ai-sdk/github-copilot",
2029+
},
2030+
})
2031+
const result = ProviderTransform.variants(model)
2032+
expect(Object.keys(result)).toEqual(["low", "medium", "high", "xhigh"])
2033+
})
20052034
})
20062035

20072036
describe("@ai-sdk/cerebras", () => {

0 commit comments

Comments
 (0)