Skip to content

Commit ae76512

Browse files
committed
fix(web): quiet the traits pill when thinking is on
Thinking on is the resting state for models that default to it, so the pill only calls out Thinking Off. This keeps the Claude custom-model pill to the reasoning level and context window.
1 parent 1bdb43e commit ae76512

2 files changed

Lines changed: 25 additions & 7 deletions

File tree

‎apps/web/src/components/chat/TraitsPicker.test.ts‎

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,17 @@ describe("buildTraitsTriggerDisplay", () => {
123123
primarySelectDescriptorId: CONTEXT_WINDOW.id,
124124
ultrathinkPromptControlled: false,
125125
}),
126-
).toEqual({ label: "1M · High Fast · Thinking On" });
126+
).toEqual({ label: "1M · High Fast" });
127+
});
128+
129+
it("shows Thinking Off as the deviation but drops Thinking On", () => {
130+
const thinking = (currentValue: boolean) =>
131+
({ id: "thinking", label: "Thinking", type: "boolean", currentValue }) as const;
132+
expect(display([thinking(true), fastModeDescriptor(true)])).toEqual({ label: "Fast" });
133+
expect(display([thinking(false), fastModeDescriptor(true)])).toEqual({
134+
label: "Thinking Off · Fast",
135+
});
136+
expect(display([thinking(true)])).toEqual({ label: "" });
127137
});
128138

129139
it.each([true, false])("keeps boolean thinking %s independent of Fast", (currentValue) => {
@@ -133,12 +143,14 @@ describe("buildTraitsTriggerDisplay", () => {
133143
type: "boolean" as const,
134144
currentValue,
135145
};
136-
const label = `Thinking ${currentValue ? "On" : "Off"}`;
137-
expect(display([thinking, fastModeDescriptor(true)])).toEqual({ label: `${label} · Fast` });
146+
const label = currentValue ? null : "Thinking Off";
147+
expect(display([thinking, fastModeDescriptor(true)])).toEqual({
148+
label: label === null ? "Fast" : `${label} · Fast`,
149+
});
138150
expect(display([thinking, { ...EFFORT, id: "reasoning" }, fastModeDescriptor(true)])).toEqual({
139-
label: `${label} · High Fast`,
151+
label: label === null ? "High Fast" : `${label} · High Fast`,
140152
});
141-
expect(display([thinking, fastModeDescriptor(false)])).toEqual({ label });
153+
expect(display([thinking, fastModeDescriptor(false)])).toEqual({ label: label ?? "Normal" });
142154
});
143155

144156
it("keeps speed separate when there is no reasoning descriptor", () => {
@@ -213,9 +225,9 @@ describe("buildTraitsTriggerDisplay", () => {
213225
id: "thinking",
214226
label: "Thinking",
215227
type: "boolean",
216-
currentValue: true,
228+
currentValue: false,
217229
};
218-
expect(display([EFFORT, thinking])).toEqual({ label: "High · Thinking On" });
230+
expect(display([EFFORT, thinking])).toEqual({ label: "High · Thinking Off" });
219231
});
220232

221233
it("falls back to a text label when fast mode is the only trait", () => {

‎apps/web/src/components/chat/TraitsPicker.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,12 @@ export function buildTraitsTriggerDisplay(input: {
576576
fastModeFallbackLabel = speedLabel ?? "Normal";
577577
continue;
578578
}
579+
// Thinking on is the resting state, so only Off claims pill space.
580+
if (descriptor.id === "thinking" && descriptor.type === "boolean") {
581+
if (descriptor.currentValue !== false) continue;
582+
labels.push("Thinking Off");
583+
continue;
584+
}
579585
if (
580586
input.provider === "codex" &&
581587
descriptor.id === "serviceTier" &&

0 commit comments

Comments
 (0)