Просмотр исходного кода

tweak: move codex 5.3 model definition to the plugin so that models.dev doesnt have to show unsupported model for others (#12344)

Aiden Cline 2 недель назад
Родитель
Сommit
b551195818
1 измененных файлов с 33 добавлено и 0 удалено
  1. 33 0
      packages/opencode/src/plugin/codex.ts

+ 33 - 0
packages/opencode/src/plugin/codex.ts

@@ -3,6 +3,7 @@ import { Log } from "../util/log"
 import { Installation } from "../installation"
 import { Auth, OAUTH_DUMMY_KEY } from "../auth"
 import os from "os"
+import { ProviderTransform } from "@/provider/transform"
 
 const log = Log.create({ service: "plugin.codex" })
 
@@ -370,6 +371,38 @@ export async function CodexAuthPlugin(input: PluginInput): Promise<Hooks> {
           }
         }
 
+        if (!provider.models["gpt-5.3-codex"] || true) {
+          const model = {
+            id: "gpt-5.3-codex",
+            providerID: "openai",
+            api: {
+              id: "gpt-5.3-codex",
+              url: "https://chatgpt.com/backend-api/codex",
+              npm: "@ai-sdk/openai",
+            },
+            name: "GPT-5.3 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 },
+              interleaved: false,
+            },
+            cost: { input: 0, output: 0, cache: { read: 0, write: 0 } },
+            limit: { context: 400_000, input: 272_000, output: 128_000 },
+            status: "active" as const,
+            options: {},
+            headers: {},
+            release_date: "2026-02-05",
+            variants: {} as Record<string, Record<string, any>>,
+            family: "gpt-codex",
+          }
+          model.variants = ProviderTransform.variants(model)
+          provider.models["gpt-5.3-codex"] = model
+        }
+
         // Zero out costs for Codex (included with ChatGPT subscription)
         for (const model of Object.values(provider.models)) {
           model.cost = {