From 61a82c7d34cce203644fa8f6b53d56faa54b00d5 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Fri, 21 Aug 2026 17:25:11 -0700 Subject: [PATCH] Offer grok-4.6 xhigh in the reasoning catalog grok-4.6 is a per-family catalog entry, not a widening of the unknown-model subset. grok-4.5 and composer stay on low/medium/high. --- src/provider/reasoning-effort.test.ts | 22 ++++++++++++++++++++++ src/provider/reasoning-effort.ts | 7 +++++++ 2 files changed, 29 insertions(+) diff --git a/src/provider/reasoning-effort.test.ts b/src/provider/reasoning-effort.test.ts index 297fc871f..b6af97aa4 100644 --- a/src/provider/reasoning-effort.test.ts +++ b/src/provider/reasoning-effort.test.ts @@ -77,6 +77,18 @@ describe("supportedEfforts", () => { test("unknown model gets the safe subset", () => { expect(supportedEfforts("some-random-model")).toEqual(["low", "medium", "high"]); }); + + test("grok-4.6 includes xhigh", () => { + expect(supportedEfforts("grok-4.6")).toEqual(["low", "medium", "high", "xhigh"]); + }); + + test("grok-4.5 stays on the unknown-model subset without xhigh", () => { + expect(supportedEfforts("grok-4.5")).toEqual(["low", "medium", "high"]); + }); + + test("grok-composer-2.5-fast stays on the unknown-model subset without xhigh", () => { + expect(supportedEfforts("grok-composer-2.5-fast")).toEqual(["low", "medium", "high"]); + }); }); describe("validateEffort", () => { @@ -97,6 +109,11 @@ describe("validateEffort", () => { expect(validateEffort("unknown", "xhigh").ok).toBe(false); expect(validateEffort("unknown", "minimal").ok).toBe(false); }); + + test("accepts xhigh on grok-4.6 and rejects it on grok-4.5", () => { + expect(validateEffort("grok-4.6", "xhigh")).toEqual({ ok: true }); + expect(validateEffort("grok-4.5", "xhigh").ok).toBe(false); + }); }); describe("cycleReasoningEffort", () => { @@ -118,6 +135,11 @@ describe("cycleReasoningEffort", () => { setModelReasoningCapabilities({ "chat-only-model": false }); expect(cycleReasoningEffort("chat-only-model", "medium")).toBeUndefined(); }); + + test("wraps high to xhigh to low on grok-4.6", () => { + expect(cycleReasoningEffort("grok-4.6", "high")).toBe("xhigh"); + expect(cycleReasoningEffort("grok-4.6", "xhigh")).toBe("low"); + }); }); describe("reasoning capability gate", () => { diff --git a/src/provider/reasoning-effort.ts b/src/provider/reasoning-effort.ts index 32894980c..604ed231e 100644 --- a/src/provider/reasoning-effort.ts +++ b/src/provider/reasoning-effort.ts @@ -36,6 +36,10 @@ const MAX_EFFORT_CODEX_MODELS: readonly string[] = ["gpt-5.6-sol", "gpt-5.6-terr // purpose: these are the levels the broadest range of reasoning models accept. const UNKNOWN_MODEL_EFFORTS: readonly ReasoningEffort[] = ["low", "medium", "high"]; +// grok-4.6 accepts xhigh; grok-4.5 and composer stay on the unknown-model subset. +const GROK_46_EFFORTS: readonly ReasoningEffort[] = ["low", "medium", "high", "xhigh"]; +const GROK_46_MODELS: readonly string[] = ["grok-4.6"]; + function isKnownOpenAIReasoningModel(model: string): boolean { return model.startsWith("gpt-5") || model.startsWith("o1") || model.startsWith("o3") || model.startsWith("o4"); } @@ -75,6 +79,9 @@ export function supportedEfforts( if (isKnownOpenAIReasoningModel(model)) { return [...DEFAULT_EFFORTS]; } + if (GROK_46_MODELS.includes(model)) { + return [...GROK_46_EFFORTS]; + } return [...UNKNOWN_MODEL_EFFORTS]; }