@devries-cameron20 / t3code-1 / commits / eeb6e23675
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(web): keep Pi thinking controls visible before selection (#27397)

Co-authored-by: maria-rcks <maria@kuuro.net>

Lakshmi Tanmay committed Nov 7, 2026 at 16:36 UTC eeb6e236750da8d63f585ea4aa30af0320dd5ca2
3 files changed +43 -3
apps/web/src/components/chat/ComposerModelEffort.tsx
+5 -1
@@ -130,7 +130,11 @@ export function describeComposerEffort(
130 ? `${reasoning.label} ${reasoning.currentValue === true ? "On" : "Off"}`
131 : ultrathink
132 ? "Ultrathink"
133 - : getProviderOptionCurrentLabel(reasoning, modelSelection, traits.reportedModelSelection);
133 + : (getProviderOptionCurrentLabel(
134 + reasoning,
135 + modelSelection,
136 + traits.reportedModelSelection,
137 + ) ?? (reasoning.id === "thinking" ? reasoning.label : null));
138 const fast = display.speedLabel === "Fast" || display.speedLabel === "Ultrafast";
139 // Agent options such as modes live in the picker; the trigger adds only the context window.
140 const contextWindow =
packages/client-runtime/src/modelTraits.test.ts new
+36
@@ -0,0 +1,36 @@
1 +import { ProviderDriverKind, type ProviderOptionDescriptor } from "@t3tools/contracts";
2 +import { describe, expect, it } from "vite-plus/test";
3 +
4 +import { buildTraitsTriggerDisplay, getDescriptorStringValue } from "./modelTraits.ts";
5 +
6 +describe("buildTraitsTriggerDisplay", () => {
7 + it.each([
8 + { currentValue: undefined, defaultValue: undefined, value: null, label: "Thinking" },
9 + { currentValue: undefined, defaultValue: "high", value: "high", label: "High" },
10 + { currentValue: "low", defaultValue: undefined, value: "low", label: "Low" },
11 + { currentValue: "max", defaultValue: "high", value: "max", label: "Max" },
12 + { id: "effort", currentValue: undefined, defaultValue: undefined, value: null, label: "" },
13 + ])("labels Pi thinking without inventing a selection: $label ($value)", (input) => {
14 + const descriptor: Extract<ProviderOptionDescriptor, { type: "select" }> = {
15 + id: input.id ?? "thinking",
16 + label: "Thinking",
17 + type: "select",
18 + options: ["low", "high", "max"].map((id) => ({
19 + id,
20 + label: id[0]!.toUpperCase() + id.slice(1),
21 + ...(id === input.defaultValue ? { isDefault: true } : {}),
22 + })),
23 + ...(input.currentValue ? { currentValue: input.currentValue } : {}),
24 + };
25 +
26 + expect(
27 + buildTraitsTriggerDisplay({
28 + provider: ProviderDriverKind.make("pi"),
29 + descriptors: [descriptor],
30 + primarySelectDescriptorId: descriptor.id,
31 + ultrathinkPromptControlled: false,
32 + }).label,
33 + ).toBe(input.label);
34 + expect(getDescriptorStringValue(descriptor)).toBe(input.value);
35 + });
36 +});
packages/client-runtime/src/modelTraits.ts
+2 -2
@@ -169,11 +169,11 @@ export function buildTraitsTriggerDisplay(input: {
169 ? "Ultrathink"
170 : descriptor.type === "boolean"
171 ? `${descriptor.label} ${descriptor.currentValue === true ? "On" : "Off"}`
172 - : getProviderOptionCurrentLabel(
172 + : (getProviderOptionCurrentLabel(
173 descriptor,
174 input.modelSelection,
175 input.reportedModelSelection,
176 - );
176 + ) ?? (descriptor.id === "thinking" ? descriptor.label : null));
177 if (typeof label === "string" && label.length > 0) {
178 if (reasoningLabelIndex === -1 && isReasoningSelect(descriptor)) {
179 reasoningLabelIndex = labels.length;