From 12aaded6c5da2b859db92cfc861d4857dc6185f6 Mon Sep 17 00:00:00 2001 From: "paseo-bot[bot]" <266920839+paseo-bot[bot]@users.noreply.github.com> Date: Wed, 14 Oct 2026 01:05:05 +0200 Subject: [PATCH] fix(app): show the configured label for the xhigh thinking option (#6005) * fix(app): respect provider label for xhigh thinking option Only fall back to the localized Extra high string for bare forms. Custom labels such as XHigh (56 | 8m) now render with their suffix. * fix(app): show Extra high only for a bare xhigh label A configured xhigh label with extra detail keeps its text; only a label that is just xhigh or Extra high uses the localized string. Co-authored-by: Elior Fureraj --------- Co-authored-by: Elior Fureraj Co-authored-by: paseo-bot[bot] <266920839+paseo-bot[bot]@users.noreply.github.com> --- packages/app/src/agent-controls/labels.test.ts | 11 +++++++++++ packages/app/src/agent-controls/labels.ts | 3 +-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/app/src/agent-controls/labels.test.ts b/packages/app/src/agent-controls/labels.test.ts index 4f1302fd1b..7310464896 100644 --- a/packages/app/src/agent-controls/labels.test.ts +++ b/packages/app/src/agent-controls/labels.test.ts @@ -29,4 +29,15 @@ describe("formatThinkingOptionLabel", () => { expect(formatThinkingOptionLabel({ id: "think-hard", label: "think-hard" })).toBe("Think hard"); expect(formatThinkingOptionLabel({ id: "xhigh", label: "XHigh" })).toBe("Extra high"); }); + + it("preserves provider-supplied xhigh labels with extra detail", () => { + expect(formatThinkingOptionLabel({ id: "xhigh", label: "XHigh (56 | 8m)" })).toBe( + "X high (56 | 8m)", + ); + expect(formatThinkingOptionLabel({ id: "xhigh", label: "XHigh (45 | 6m)" })).toBe( + "X high (45 | 6m)", + ); + expect(formatThinkingOptionLabel({ id: "xhigh" })).toBe("Extra high"); + expect(formatThinkingOptionLabel({ id: "xhigh", label: "Extra high" })).toBe("Extra high"); + }); }); diff --git a/packages/app/src/agent-controls/labels.ts b/packages/app/src/agent-controls/labels.ts index ff32aaf4dc..704298f78c 100644 --- a/packages/app/src/agent-controls/labels.ts +++ b/packages/app/src/agent-controls/labels.ts @@ -34,10 +34,9 @@ export function formatAgentModeLabel(mode: ControlLabelInput): string { export function formatThinkingOptionLabel(option: ControlLabelInput): string { const rawLabel = (option.label ?? option.id).trim(); - const compactId = option.id.replace(/[\s_-]+/g, "").toLowerCase(); const compactLabel = rawLabel.replace(/[\s_-]+/g, "").toLowerCase(); - if (compactId === "xhigh" || compactLabel === "xhigh") { + if (compactLabel === "xhigh" || compactLabel === "extrahigh") { return i18n.t("agentControls.thinking.extraHigh"); }