diff --git a/packages/opencode/src/plugin/openai/codex.ts b/packages/opencode/src/plugin/openai/codex.ts index 6ead52c813..0e18b0ea40 100644 --- a/packages/opencode/src/plugin/openai/codex.ts +++ b/packages/opencode/src/plugin/openai/codex.ts @@ -12,7 +12,14 @@ const ISSUER = "https://auth.openai.com" const CODEX_API_ENDPOINT = "https://chatgpt.com/backend-api/codex/responses" const OAUTH_PORT = 1455 const OAUTH_POLLING_SAFETY_MARGIN_MS = 3000 -const ALLOWED_MODELS = new Set(["gpt-5.5", "gpt-5.3-codex-spark", "gpt-5.4", "gpt-5.4-mini"]) +const ALLOWED_MODELS = new Set([ + "gpt-5.5", + "gpt-5.3-codex-spark", + "gpt-5.4", + "gpt-5.4-mini", + "gpt-6-sol", + "gpt-6-luna", +]) const DISALLOWED_MODELS = new Set(["gpt-5.5-pro"]) interface PkceCodes { diff --git a/packages/opencode/test/plugin/codex.test.ts b/packages/opencode/test/plugin/codex.test.ts index 159f7806a7..54b2f18edb 100644 --- a/packages/opencode/test/plugin/codex.test.ts +++ b/packages/opencode/test/plugin/codex.test.ts @@ -289,10 +289,16 @@ describe("plugin.codex", () => { const provider = { models: { ...Object.fromEntries( - ["gpt-5.4", "gpt-5.5", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-5.7-pro"].map((id) => [ - id, - { id, api: { id }, limit, cost: {}, options: {} }, - ]), + [ + "gpt-5.4", + "gpt-5.5", + "gpt-5.6-sol", + "gpt-5.6-terra", + "gpt-5.6-luna", + "gpt-5.7-pro", + "gpt-6-sol", + "gpt-6-luna", + ].map((id) => [id, { id, api: { id }, limit, cost: {}, options: {} }]), ), "gpt-5.4-pro": { id: "gpt-5.4-pro", @@ -318,6 +324,8 @@ describe("plugin.codex", () => { expect(models["gpt-5.6-sol"]?.limit).toEqual({ context: 400_000, input: 272_000, output: 128_000 }) expect(models["gpt-5.6-terra"]?.limit).toEqual({ context: 400_000, input: 272_000, output: 128_000 }) expect(models["gpt-5.6-luna"]?.limit).toEqual({ context: 400_000, input: 272_000, output: 128_000 }) + expect(models["gpt-6-sol"]).toBeDefined() + expect(models["gpt-6-luna"]).toBeDefined() expect(models["gpt-5.4-pro"]).toBeUndefined() expect(models["gpt-5.7-pro"]).toBeDefined() expect(models["gpt-5.6-sol-high"]).toBeDefined()