From de7b2ba7d523e37521d4acc7cc682dbc5ecebd74 Mon Sep 17 00:00:00 2001 From: Darshil Date: Thu, 5 Feb 2026 15:56:26 -0800 Subject: [PATCH] fix: normalize xhigh aliases and docs sync (#9976) --- docs/tools/thinking.md | 2 +- src/auto-reply/thinking.test.ts | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/tools/thinking.md b/docs/tools/thinking.md index 9dc50f8284..c01ea540f0 100644 --- a/docs/tools/thinking.md +++ b/docs/tools/thinking.md @@ -16,7 +16,7 @@ title: "Thinking Levels" - medium → “think harder” - high → “ultrathink” (max budget) - xhigh → “ultrathink+” (GPT-5.2 + Codex models only) - - `x-high` and `extra-high` map to `xhigh`. + - `x-high`, `x_high`, `extra-high`, `extra high`, and `extra_high` map to `xhigh`. - `highest`, `max` map to `high`. - Provider notes: - Z.AI (`zai/*`) only supports binary thinking (`on`/`off`). Any non-`off` level is treated as `on` (mapped to `low`). diff --git a/src/auto-reply/thinking.test.ts b/src/auto-reply/thinking.test.ts index cb053f4c8b..5dd630185c 100644 --- a/src/auto-reply/thinking.test.ts +++ b/src/auto-reply/thinking.test.ts @@ -11,8 +11,23 @@ describe("normalizeThinkLevel", () => { expect(normalizeThinkLevel("mid")).toBe("medium"); }); - it("accepts xhigh", () => { + it("accepts xhigh aliases", () => { expect(normalizeThinkLevel("xhigh")).toBe("xhigh"); + expect(normalizeThinkLevel("x-high")).toBe("xhigh"); + expect(normalizeThinkLevel("x_high")).toBe("xhigh"); + expect(normalizeThinkLevel("x high")).toBe("xhigh"); + }); + + it("accepts extra-high aliases as xhigh", () => { + expect(normalizeThinkLevel("extra-high")).toBe("xhigh"); + expect(normalizeThinkLevel("extra high")).toBe("xhigh"); + expect(normalizeThinkLevel("extra_high")).toBe("xhigh"); + expect(normalizeThinkLevel(" extra high ")).toBe("xhigh"); + }); + + it("does not over-match nearby xhigh words", () => { + expect(normalizeThinkLevel("extra-highest")).toBeUndefined(); + expect(normalizeThinkLevel("xhigher")).toBeUndefined(); }); it("accepts extra-high aliases as xhigh", () => {