The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 23:15 UTC
fix(web,client-runtime): subagent cards show Cursor reasoning effort (#17419)
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> Co-authored-by: Julius Marminge <julius0216@outlook.com>
IlyaL committed
Oct 19, 2026 at 21:15 UTC
dd86a020965d4fba852769b8346460126bcb0e38
7 files changed
+42
-36
apps/web/src/components/chat/SubagentTooltipContent.tsx
+4
-3
@@ -11,6 +11,7 @@ import {
11
resolveSubagentMetadata,
12
subagentDetailPreview,
13
} from "@t3tools/client-runtime/state/subagent-display";
14
+import { REASONING_EFFORT_OPTION_IDS } from "@t3tools/client-runtime/state/thread-execution";
15
import { getModelSelectionStringOptionValue, resolveSelectableModel } from "@t3tools/shared/model";
16
import { getTraitsSpeedDisplay, TraitsSpeedIcon } from "./TraitsSpeed";
17
import type { ReactNode } from "react";
@@ -72,9 +73,9 @@ export function SubagentTooltipContent(props: {
73
childModel === (modelSlug ?? model) && childSelection?.instanceId === props.providerInstanceId
74
? childSelection
75
: undefined;
75
- const effort = ["reasoningEffort", "effort", "reasoning", "variant"]
76
- .map((id) => getModelSelectionStringOptionValue(matchingSelection, id))
77
- .find(Boolean);
76
+ const effort = REASONING_EFFORT_OPTION_IDS.map((id) =>
77
+ getModelSelectionStringOptionValue(matchingSelection, id),
78
+ ).find(Boolean);
79
const speed = provider
80
? providerModel?.capabilities?.optionDescriptors
81
?.map((descriptor) => {
apps/web/src/components/chat/ThreadRelationshipsControl.agents.browser.test.tsx
+1
@@ -893,6 +893,7 @@ it("shows readable models and only differing workspace details in agent tooltips
893
[[{ id: "reasoning", value: "low" }], " · low"],
894
[[{ id: "variant", value: "high" }], " · high"],
895
[[{ id: "reasoningEffort", value: "none" }], " · none"],
896
+ [[{ id: "reasoning_effort", value: "xhigh" }], " · xhigh"],
897
[[{ id: "reasoningEffort", value: true }], ""],
898
[[{ id: "serviceTier", value: "fast" }], ""],
899
[[], ""],
apps/web/src/components/chat/TraitsPicker.test.ts
+4
-3
@@ -115,14 +115,15 @@ describe("buildTraitsTriggerDisplay", () => {
115
buildTraitsTriggerDisplay({
116
provider: ProviderDriverKind.make("cursor"),
117
descriptors: [
118
- { ...EFFORT, id: "reasoning" },
118
+ CONTEXT_WINDOW,
119
+ { ...EFFORT, id: "reasoning_effort" },
120
fastModeDescriptor(true),
121
{ id: "thinking", label: "Thinking", type: "boolean", currentValue: true },
122
],
122
- primarySelectDescriptorId: "reasoning",
123
+ primarySelectDescriptorId: CONTEXT_WINDOW.id,
124
ultrathinkPromptControlled: false,
125
}),
125
- ).toEqual({ label: "High Fast · Thinking On" });
126
+ ).toEqual({ label: "1M · High Fast · Thinking On" });
127
});
128
129
it.each([true, false])("keeps boolean thinking %s independent of Fast", (currentValue) => {
apps/web/src/components/chat/TraitsPicker.tsx
+2
-4
@@ -16,6 +16,7 @@ import {
16
isClaudeUltrathinkPrompt,
17
normalizeModelSlug,
18
} from "@t3tools/shared/model";
19
+import { REASONING_EFFORT_OPTION_IDS } from "@t3tools/client-runtime/state/thread-execution";
20
import { memo } from "react";
21
import { BrainIcon } from "lucide-react";
22
import {
@@ -92,10 +93,7 @@ type TraitsPersistence =
93
const ULTRATHINK_PROMPT_PREFIX = "Ultrathink:\n";
94
95
const REASONING_SELECT_DESCRIPTOR_IDS: ReadonlySet<string> = new Set([
95
- "reasoningEffort",
96
- "reasoning",
97
- "effort",
98
- "variant",
96
+ ...REASONING_EFFORT_OPTION_IDS,
97
"thinking",
98
]);
99
apps/web/src/components/chat/composerProviderState.test.tsx
+3
-3
@@ -616,17 +616,17 @@ describe("getComposerReasoningStep", () => {
616
provider: ProviderDriverKind.make("cursor"),
617
instanceId: ProviderInstanceId.make("cursor"),
618
models: modelWith([
619
- selectDescriptor("reasoning", LEVELS),
619
+ selectDescriptor("reasoning_effort", LEVELS),
620
booleanDescriptor("fastMode", true),
621
]),
622
};
623
624
expect(step({ ...cursor, modelOptions: undefined })?.modelOptions).toStrictEqual(
625
- selections(["reasoning", "high"], ["fastMode", false]),
625
+ selections(["reasoning_effort", "high"], ["fastMode", false]),
626
);
627
expect(
628
step({ ...cursor, modelOptions: selections(["fastMode", true]) })?.modelOptions,
629
- ).toStrictEqual(selections(["reasoning", "high"], ["fastMode", true]));
629
+ ).toStrictEqual(selections(["reasoning_effort", "high"], ["fastMode", true]));
630
});
631
632
it("steps from the provider-reported level for the same instance and model", () => {
packages/client-runtime/src/state/threadExecution.test.ts
+21
-22
@@ -441,7 +441,7 @@ describe("formatModelSelectionEffort", () => {
441
model: "claude-sonnet-5",
442
...(options === undefined ? {} : { options }),
443
});
444
- const catalog = (descriptor: { currentValue?: string }) => [
444
+ const catalog = (descriptor: { id?: string; currentValue?: string }) => [
445
{
446
slug: "claude-sonnet-5",
447
name: "Claude Sonnet 5",
@@ -464,27 +464,26 @@ describe("formatModelSelectionEffort", () => {
464
},
465
];
466
467
- it("names stored and matching reported effort, preferring the stored choice", () => {
468
- expect(
469
- formatModelSelectionEffort(selection([{ id: "effort", value: "xhigh" }]), catalog({})),
470
- ).toBe("Extra High");
471
- const reported = selection([{ id: "effort", value: "xhigh" }]);
472
- expect(formatModelSelectionEffort(selection(), catalog({}), reported)).toBe("Extra High");
473
- expect(
474
- formatModelSelectionEffort(
475
- selection([{ id: "effort", value: "medium" }]),
476
- catalog({}),
477
- reported,
478
- ),
479
- ).toBe("Medium");
480
- expect(
481
- formatModelSelectionEffort(
482
- selection([{ id: "effort", value: "retired-effort" }]),
483
- catalog({ currentValue: "medium" }),
484
- reported,
485
- ),
486
- ).toBeNull();
487
- });
467
+ it.each(["effort", "reasoning_effort"])(
468
+ "names stored and matching reported %s, preferring the stored choice",
469
+ (id) => {
470
+ expect(formatModelSelectionEffort(selection([{ id, value: "xhigh" }]), catalog({ id }))).toBe(
471
+ "Extra High",
472
+ );
473
+ const reported = selection([{ id, value: "xhigh" }]);
474
+ expect(formatModelSelectionEffort(selection(), catalog({ id }), reported)).toBe("Extra High");
475
+ expect(
476
+ formatModelSelectionEffort(selection([{ id, value: "medium" }]), catalog({ id }), reported),
477
+ ).toBe("Medium");
478
+ expect(
479
+ formatModelSelectionEffort(
480
+ selection([{ id, value: "retired-effort" }]),
481
+ catalog({ id, currentValue: "medium" }),
482
+ reported,
483
+ ),
484
+ ).toBeNull();
485
+ },
486
+ );
487
488
it("shows nothing when neither the selection nor the provider states an effort", () => {
489
expect(formatModelSelectionEffort(selection(), catalog({}))).toBeNull();
packages/client-runtime/src/state/threadExecution.ts
+7
-1
@@ -151,7 +151,13 @@ export function deriveReportedModelSelection(
151
return providerThread?.nativeMetadata?.modelSelection ?? null;
152
}
153
154
-const REASONING_EFFORT_OPTION_IDS = ["reasoningEffort", "effort", "reasoning", "variant"] as const;
154
+export const REASONING_EFFORT_OPTION_IDS: ReadonlyArray<string> = [
155
+ "reasoningEffort",
156
+ "effort",
157
+ "reasoning",
158
+ "variant",
159
+ "reasoning_effort",
160
+];
161
162
export function formatModelSelectionEffort(
163
selection: ModelSelection,