Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/opencode/src/provider/transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ const WIDELY_SUPPORTED_EFFORTS = ["low", "medium", "high"]
const OPENAI_EFFORTS = ["none", "minimal", ...WIDELY_SUPPORTED_EFFORTS, "xhigh"]
const OPENAI_GPT5_1_EFFORTS = ["none", ...WIDELY_SUPPORTED_EFFORTS]
const OPENAI_GPT5_2_PLUS_EFFORTS = [...OPENAI_GPT5_1_EFFORTS, "xhigh"]
const OPENAI_GPT5_6_PLUS_EFFORTS = [...OPENAI_GPT5_2_PLUS_EFFORTS, "max"]
const OPENAI_GPT5_PRO_EFFORTS = ["high"]
const OPENAI_GPT5_PRO_2_PLUS_EFFORTS = ["medium", "high", "xhigh"]
const OPENAI_GPT5_CHAT_EFFORTS = ["medium"]
Expand Down Expand Up @@ -551,6 +552,7 @@ function versionedGpt5ReasoningEfforts(apiId: string) {
const version = gpt5Version(apiId)
if (version === undefined) return undefined
if (version === 1) return OPENAI_GPT5_1_EFFORTS
if (version >= 6) return OPENAI_GPT5_6_PLUS_EFFORTS
return OPENAI_GPT5_2_PLUS_EFFORTS
}

Expand Down Expand Up @@ -580,7 +582,7 @@ function openaiReasoningEfforts(apiId: string, releaseDate: string) {
if (codexEfforts) return codexEfforts
const versionedEfforts = versionedGpt5ReasoningEfforts(id)
// GPT-5.1 replaced GPT-5's `minimal` effort with `none`; GPT-5.2+
// additionally accepts `xhigh`. Model pages list the supported subset.
// additionally accepts `xhigh`, and GPT-5.6+ accepts `max`.
if (versionedEfforts) return versionedEfforts
const efforts = [...WIDELY_SUPPORTED_EFFORTS]
if (GPT5_FAMILY_RE.test(id)) efforts.unshift("minimal")
Expand Down
6 changes: 6 additions & 0 deletions packages/opencode/test/provider/transform.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3301,6 +3301,7 @@ describe("ProviderTransform.variants", () => {
for (const testCase of [
{ id: "openai/o3-mini", efforts: ["none", "minimal", "low", "medium", "high", "xhigh"] },
{ id: "openai/gpt-5.4", efforts: ["none", "low", "medium", "high", "xhigh"] },
{ id: "openai/gpt-5.6-sol", efforts: ["none", "low", "medium", "high", "xhigh", "max"] },
{ id: "openai/gpt-5-pro", efforts: ["high"] },
{ id: "openai/gpt-5.5-pro", efforts: ["medium", "high", "xhigh"] },
{ id: "openai/gpt-5.2-codex", efforts: ["low", "medium", "high", "xhigh"] },
Expand Down Expand Up @@ -4005,6 +4006,11 @@ describe("ProviderTransform.variants", () => {
releaseDate: "2026-04-23",
efforts: ["none", "low", "medium", "high", "xhigh"],
},
{
id: "gpt-5.6-sol",
releaseDate: "2026-07-09",
efforts: ["none", "low", "medium", "high", "xhigh", "max"],
},
{ id: "gpt-5.4-pro", releaseDate: "2026-03-05", efforts: ["medium", "high", "xhigh"] },
{ id: "gpt-5.5-pro", releaseDate: "2026-04-23", efforts: ["medium", "high", "xhigh"] },
{ id: "gpt-5-codex", releaseDate: "2025-09-23", efforts: ["low", "medium", "high"] },
Expand Down
Loading