diff --git a/.changeset/hide-gpt-5-5-pro.md b/.changeset/hide-gpt-5-5-pro.md new file mode 100644 index 00000000000..68aa099db8e --- /dev/null +++ b/.changeset/hide-gpt-5-5-pro.md @@ -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. diff --git a/packages/opencode/src/plugin/openai/codex.ts b/packages/opencode/src/plugin/openai/codex.ts index 9eb9710b21a..9d9ef12116f 100644 --- a/packages/opencode/src/plugin/openai/codex.ts +++ b/packages/opencode/src/plugin/openai/codex.ts @@ -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 @@ -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 }) diff --git a/packages/opencode/test/plugin/codex.test.ts b/packages/opencode/test/plugin/codex.test.ts index a375fe4ee10..0be3ab63bbd 100644 --- a/packages/opencode/test/plugin/codex.test.ts +++ b/packages/opencode/test/plugin/codex.test.ts @@ -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 })