Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/hide-gpt-5-5-pro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@kilocode/cli": patch
"kilo-code": patch
---

Hide gpt-5.5-pro from the model picker when using ChatGPT OAuth login, since Codex rejects it with HTTP 400.
6 changes: 6 additions & 0 deletions packages/opencode/src/plugin/openai/codex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ const ALLOWED_MODELS = new Set([
"gpt-5.2-codex",
// kilocode_change end
])
// kilocode_change start
const DISALLOWED_MODELS = new Set([
"gpt-5.5-pro",
])
// kilocode_change end

interface PkceCodes {
verifier: string
Expand Down Expand Up @@ -394,6 +399,7 @@ export async function CodexAuthPlugin(input: PluginInput, options: CodexAuthPlug
Object.entries(provider.models)
.filter(([, model]) => {
if (ALLOWED_MODELS.has(model.api.id)) return true
if (DISALLOWED_MODELS.has(model.api.id)) return false // kilocode_change
const match = model.api.id.match(/^gpt-(\d+\.\d+)/)
return match ? parseFloat(match[1]) > 5.4 : false
})
Expand Down
62 changes: 62 additions & 0 deletions packages/opencode/test/plugin/codex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,68 @@ describe("plugin.codex", () => {
})
})

// kilocode_change start
describe("models filter", () => {
test("filters out disallowed models for oauth users", async () => {
const hooks = await CodexAuthPlugin({} as never)
const provider = await hooks.provider!.models!({
id: "openai",
baseURL: "",
apiKey: "",
models: {
"gpt-5.5-pro": {
id: "gpt-5.5-pro",
api: { id: "gpt-5.5-pro" },
} as never,
"gpt-5.5": {
id: "gpt-5.5",
api: { id: "gpt-5.5" },
} as never,
"gpt-5.4-mini": {
id: "gpt-5.4-mini",
api: { id: "gpt-5.4-mini" },
} as never,
"gpt-5.1-codex": {
id: "gpt-5.1-codex",
api: { id: "gpt-5.1-codex" },
} as never,
"other-model": {
id: "other-model",
api: { id: "other-model" },
} as never,
},
} as never, { auth: { type: "oauth" } } as never)
expect(provider).not.toHaveProperty(["gpt-5.5-pro"])
expect(provider).toHaveProperty(["gpt-5.5"])
expect(provider).toHaveProperty(["gpt-5.4-mini"])
expect(provider).toHaveProperty(["gpt-5.1-codex"])
expect(provider).not.toHaveProperty(["other-model"])
})

test("passes through all models when not using oauth", async () => {
const hooks = await CodexAuthPlugin({} as never)
const models = {
"gpt-5.5-pro": {
id: "gpt-5.5-pro",
api: { id: "gpt-5.5-pro" },
} as never,
"other-model": {
id: "other-model",
api: { id: "other-model" },
} as never,
}
const provider = await hooks.provider!.models!({
id: "openai",
baseURL: "",
apiKey: "",
models,
} as never, { auth: { type: "api", key: "sk-test" } } as never)
expect(provider).toHaveProperty(["gpt-5.5-pro"])
expect(provider).toHaveProperty(["other-model"])
})
})
// kilocode_change end

test("installs websocket transport only when experimental websockets are enabled", async () => {
const disabled = await CodexAuthPlugin({} as never)
const enabled = await CodexAuthPlugin({} as never, { experimentalWebSockets: true })
Expand Down
Loading