feat(openai): allow GPT-6 Sol and Luna with Codex (#50704)

Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
This commit is contained in:
opencode-agent[bot] 2026-09-22 13:36:43 -05:00 committed by GitHub
parent fe3f3a41f7
commit 3a35b45db8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 5 deletions

View file

@ -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 {

View file

@ -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()