Skip to content

Commit cb8e27c

Browse files
Merge pull request #492 from corbitsdev/cl-6573-offer-grok-46-xhigh-in-the-reasoning-catalog
Offer grok-4.6 xhigh in the reasoning catalog
2 parents e17f4f4 + 61a82c7 commit cb8e27c

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

src/provider/reasoning-effort.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ describe("supportedEfforts", () => {
7777
test("unknown model gets the safe subset", () => {
7878
expect(supportedEfforts("some-random-model")).toEqual(["low", "medium", "high"]);
7979
});
80+
81+
test("grok-4.6 includes xhigh", () => {
82+
expect(supportedEfforts("grok-4.6")).toEqual(["low", "medium", "high", "xhigh"]);
83+
});
84+
85+
test("grok-4.5 stays on the unknown-model subset without xhigh", () => {
86+
expect(supportedEfforts("grok-4.5")).toEqual(["low", "medium", "high"]);
87+
});
88+
89+
test("grok-composer-2.5-fast stays on the unknown-model subset without xhigh", () => {
90+
expect(supportedEfforts("grok-composer-2.5-fast")).toEqual(["low", "medium", "high"]);
91+
});
8092
});
8193

8294
describe("validateEffort", () => {
@@ -97,6 +109,11 @@ describe("validateEffort", () => {
97109
expect(validateEffort("unknown", "xhigh").ok).toBe(false);
98110
expect(validateEffort("unknown", "minimal").ok).toBe(false);
99111
});
112+
113+
test("accepts xhigh on grok-4.6 and rejects it on grok-4.5", () => {
114+
expect(validateEffort("grok-4.6", "xhigh")).toEqual({ ok: true });
115+
expect(validateEffort("grok-4.5", "xhigh").ok).toBe(false);
116+
});
100117
});
101118

102119
describe("cycleReasoningEffort", () => {
@@ -118,6 +135,11 @@ describe("cycleReasoningEffort", () => {
118135
setModelReasoningCapabilities({ "chat-only-model": false });
119136
expect(cycleReasoningEffort("chat-only-model", "medium")).toBeUndefined();
120137
});
138+
139+
test("wraps high to xhigh to low on grok-4.6", () => {
140+
expect(cycleReasoningEffort("grok-4.6", "high")).toBe("xhigh");
141+
expect(cycleReasoningEffort("grok-4.6", "xhigh")).toBe("low");
142+
});
121143
});
122144

123145
describe("reasoning capability gate", () => {

src/provider/reasoning-effort.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ const MAX_EFFORT_CODEX_MODELS: readonly string[] = ["gpt-5.6-sol", "gpt-5.6-terr
3636
// purpose: these are the levels the broadest range of reasoning models accept.
3737
const UNKNOWN_MODEL_EFFORTS: readonly ReasoningEffort[] = ["low", "medium", "high"];
3838

39+
// grok-4.6 accepts xhigh; grok-4.5 and composer stay on the unknown-model subset.
40+
const GROK_46_EFFORTS: readonly ReasoningEffort[] = ["low", "medium", "high", "xhigh"];
41+
const GROK_46_MODELS: readonly string[] = ["grok-4.6"];
42+
3943
function isKnownOpenAIReasoningModel(model: string): boolean {
4044
return model.startsWith("gpt-5") || model.startsWith("o1") || model.startsWith("o3") || model.startsWith("o4");
4145
}
@@ -75,6 +79,9 @@ export function supportedEfforts(
7579
if (isKnownOpenAIReasoningModel(model)) {
7680
return [...DEFAULT_EFFORTS];
7781
}
82+
if (GROK_46_MODELS.includes(model)) {
83+
return [...GROK_46_EFFORTS];
84+
}
7885
return [...UNKNOWN_MODEL_EFFORTS];
7986
}
8087

0 commit comments

Comments
 (0)