From d92b4f94bf71253cb2d20951fcb16339faef4a52 Mon Sep 17 00:00:00 2001 From: Alessandro Pogliaghi Date: Mon, 13 Jul 2026 09:36:26 +0100 Subject: [PATCH] fix(models): offer max reasoning for gpt-5.6 Generated-By: PostHog Code Task-Id: ca902a14-9a81-4604-b32f-09a49c52c9c9 --- .../src/adapters/codex-app-server/models.test.ts | 13 +++++++++++-- .../agent/src/adapters/codex-app-server/models.ts | 13 ++++++++++--- .../agent/src/adapters/reasoning-effort.test.ts | 4 ++-- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/packages/agent/src/adapters/codex-app-server/models.test.ts b/packages/agent/src/adapters/codex-app-server/models.test.ts index 76cb8041e4..3df008e07b 100644 --- a/packages/agent/src/adapters/codex-app-server/models.test.ts +++ b/packages/agent/src/adapters/codex-app-server/models.test.ts @@ -4,6 +4,7 @@ import { formatCodexModelName, getReasoningEffortOptions, modelIdFromConfigOptions, + supportsMaxEffort, supportsXhighEffort, } from "./models"; @@ -30,8 +31,8 @@ describe("getReasoningEffortOptions", () => { "gpt-5.6-luna", "openai/gpt-5.6-sol", "GPT-5.6-SOL", - ])("offers Extra High for the gpt-5.6 family (%s)", (modelId) => { - expect(values(modelId)).toEqual(["low", "medium", "high", "xhigh"]); + ])("offers Max for the gpt-5.6 family (%s)", (modelId) => { + expect(values(modelId)).toEqual(["low", "medium", "high", "xhigh", "max"]); }); it.each(["gpt-5.3-codex", "gpt-5.1", "o3"])( @@ -57,6 +58,14 @@ describe("supportsXhighEffort", () => { }); }); +describe("supportsMaxEffort", () => { + it("is true only for the gpt-5.6 family", () => { + expect(supportsMaxEffort("gpt-5.6-sol")).toBe(true); + expect(supportsMaxEffort("GPT-5.6-LUNA")).toBe(true); + expect(supportsMaxEffort("gpt-5.5")).toBe(false); + }); +}); + describe("modelIdFromConfigOptions", () => { const modelOption = (currentValue: unknown): SessionConfigOption => ({ diff --git a/packages/agent/src/adapters/codex-app-server/models.ts b/packages/agent/src/adapters/codex-app-server/models.ts index 250c0dc77e..af3989fc99 100644 --- a/packages/agent/src/adapters/codex-app-server/models.ts +++ b/packages/agent/src/adapters/codex-app-server/models.ts @@ -15,14 +15,18 @@ const CODEX_REASONING_EFFORT_OPTIONS: ReasoningEffortOption[] = [ { value: "high", name: "High" }, ]; -// OpenAI's `reasoning_effort` exposes an "extra high" tier only on the gpt-5.5 -// and gpt-5.6 families, matching what the Codex app offers. Older models top -// out at "high". +// OpenAI's `reasoning_effort` exposes an "extra high" tier on the gpt-5.5 and +// gpt-5.6 families. GPT-5.6 also supports the "max" tier. Older models top out +// at "high". export function supportsXhighEffort(modelId: string): boolean { const id = modelId.toLowerCase(); return id.includes("gpt-5.5") || id.includes("gpt-5.6"); } +export function supportsMaxEffort(modelId: string): boolean { + return modelId.toLowerCase().includes("gpt-5.6"); +} + export function getReasoningEffortOptions( modelId: string, ): ReasoningEffortOption[] { @@ -30,6 +34,9 @@ export function getReasoningEffortOptions( if (supportsXhighEffort(modelId)) { options.push({ value: "xhigh", name: "Extra High" }); } + if (supportsMaxEffort(modelId)) { + options.push({ value: "max", name: "Max" }); + } return options; } diff --git a/packages/agent/src/adapters/reasoning-effort.test.ts b/packages/agent/src/adapters/reasoning-effort.test.ts index d3ea85d43f..26248716ee 100644 --- a/packages/agent/src/adapters/reasoning-effort.test.ts +++ b/packages/agent/src/adapters/reasoning-effort.test.ts @@ -15,12 +15,12 @@ describe("isSupportedReasoningEffort", () => { ); }); - it("accepts xhigh but not max for the codex gpt-5.6 family", () => { + it("accepts xhigh and max for the codex gpt-5.6 family", () => { expect(isSupportedReasoningEffort("codex", "gpt-5.6-luna", "xhigh")).toBe( true, ); expect(isSupportedReasoningEffort("codex", "gpt-5.6-sol", "max")).toBe( - false, + true, ); });