From b03172d723ad570b8c82f010b1511de89d630d9d Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Fri, 9 Jan 2026 19:15:50 -0600 Subject: [PATCH] fix: ensure gpt-5.2-codex has variants --- packages/opencode/src/plugin/codex.ts | 10 ++++++++-- packages/opencode/src/provider/transform.ts | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/opencode/src/plugin/codex.ts b/packages/opencode/src/plugin/codex.ts index 2101d5bc3..d0f025b06 100644 --- a/packages/opencode/src/plugin/codex.ts +++ b/packages/opencode/src/plugin/codex.ts @@ -1,6 +1,7 @@ import type { Hooks, PluginInput } from "@opencode-ai/plugin" import { Log } from "../util/log" import { OAUTH_DUMMY_KEY } from "../auth" +import { ProviderTransform } from "../provider/transform" const log = Log.create({ service: "plugin.codex" }) @@ -321,7 +322,7 @@ export async function CodexAuthPlugin(input: PluginInput): Promise { } if (!provider.models["gpt-5.2-codex"]) { - provider.models["gpt-5.2-codex"] = { + const model = { id: "gpt-5.2-codex", providerID: "openai", api: { @@ -337,13 +338,18 @@ export async function CodexAuthPlugin(input: PluginInput): Promise { toolcall: true, input: { text: true, audio: false, image: true, video: false, pdf: false }, output: { text: true, audio: false, image: false, video: false, pdf: false }, + interleaved: false, }, cost: { input: 0, output: 0, cache: { read: 0, write: 0 } }, limit: { context: 400000, output: 128000 }, - status: "active", + status: "active" as const, options: {}, headers: {}, + release_date: "2025-12-18", + variants: {} as Record>, } + model.variants = ProviderTransform.variants(model) + provider.models["gpt-5.2-codex"] = model } // Zero out costs for Codex (included with ChatGPT subscription) diff --git a/packages/opencode/src/provider/transform.ts b/packages/opencode/src/provider/transform.ts index 080da6378..08f329ec1 100644 --- a/packages/opencode/src/provider/transform.ts +++ b/packages/opencode/src/provider/transform.ts @@ -318,7 +318,7 @@ export namespace ProviderTransform { // https://v5.ai-sdk.dev/providers/ai-sdk-providers/openai if (id === "gpt-5-pro") return {} const openaiEfforts = iife(() => { - if (id.includes("codex")) return WIDELY_SUPPORTED_EFFORTS + if (id.includes("codex") && !id.includes("5.2")) return WIDELY_SUPPORTED_EFFORTS const arr = [...WIDELY_SUPPORTED_EFFORTS] if (id.includes("gpt-5-") || id === "gpt-5") { arr.unshift("minimal")