From a300cd6465c66a6f96f486245acd9aa8d0fda24b Mon Sep 17 00:00:00 2001 From: Aiden Cline Date: Fri, 9 Jan 2026 17:06:13 -0600 Subject: [PATCH] fix: model list --- packages/opencode/src/plugin/codex.ts | 34 +++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/packages/opencode/src/plugin/codex.ts b/packages/opencode/src/plugin/codex.ts index 223e4621c7..f098a39671 100644 --- a/packages/opencode/src/plugin/codex.ts +++ b/packages/opencode/src/plugin/codex.ts @@ -263,6 +263,40 @@ export async function CodexAuthPlugin(input: PluginInput): Promise { const auth = await getAuth() if (auth.type !== "oauth") return {} + // Filter models to only allowed Codex models for OAuth + const allowedModels = new Set(["gpt-5.1-codex-max", "gpt-5.1-codex-mini", "gpt-5.2", "gpt-5.2-codex"]) + for (const modelId of Object.keys(provider.models)) { + if (!allowedModels.has(modelId)) { + delete provider.models[modelId] + } + } + + if (!provider.models["gpt-5.2-codex"]) { + provider.models["gpt-5.2-codex"] = { + id: "gpt-5.2-codex", + providerID: "openai", + api: { + id: "gpt-5.2-codex", + url: "https://chatgpt.com/backend-api/codex", + npm: "@ai-sdk/openai", + }, + name: "GPT-5.2 Codex", + capabilities: { + temperature: false, + reasoning: true, + attachment: true, + toolcall: true, + input: { text: true, audio: false, image: true, video: false, pdf: false }, + output: { text: true, audio: false, image: false, video: false, pdf: false }, + }, + cost: { input: 0, output: 0, cache: { read: 0, write: 0 } }, + limit: { context: 400000, output: 128000 }, + status: "active", + options: {}, + headers: {}, + } + } + // Zero out costs for Codex (included with ChatGPT subscription) for (const model of Object.values(provider.models)) { model.cost = {