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 24, 19:00 UTC
fix(web): show Codex fast mode as a bolt (#4947)
Theo Browne committed
Jul 30, 2026 at 02:15 UTC
9146ed2f49a094aa8afee7d3a66987e2a82aaaf6
2 files changed
+30
-24
apps/web/src/components/chat/TraitsPicker.test.ts
+20
-12
@@ -35,39 +35,48 @@ const CONTEXT_WINDOW = selectDescriptor(
35
36
const CODEX = ProviderDriverKind.make("codex");
37
38
-function display(descriptors: ReadonlyArray<ProviderOptionDescriptor>, fastModeEnabled: boolean) {
38
+function display(descriptors: ReadonlyArray<ProviderOptionDescriptor>) {
39
return buildTraitsTriggerDisplay({
40
provider: CODEX,
41
descriptors,
42
primarySelectDescriptorId: "reasoningEffort",
43
ultrathinkPromptControlled: false,
44
- fastModeEnabled,
44
});
45
}
46
47
describe("buildTraitsTriggerDisplay", () => {
48
it("omits fast mode from the label entirely when it is off", () => {
50
- expect(display([EFFORT, fastModeDescriptor(false), CONTEXT_WINDOW], false)).toEqual({
49
+ expect(display([EFFORT, fastModeDescriptor(false), CONTEXT_WINDOW])).toEqual({
50
label: "High · 1M",
51
showFastModeIcon: false,
52
});
53
});
54
55
it("shows the bolt instead of a text label when fast mode is on", () => {
57
- expect(display([EFFORT, fastModeDescriptor(true), CONTEXT_WINDOW], true)).toEqual({
56
+ expect(display([EFFORT, fastModeDescriptor(true), CONTEXT_WINDOW])).toEqual({
57
label: "High · 1M",
58
showFastModeIcon: true,
59
});
60
});
61
63
- it("omits Codex's default Standard tier beside reasoning", () => {
62
+ it("renders Codex's Standard and Fast service tiers as fast mode", () => {
63
const serviceTier = selectDescriptor(
64
"serviceTier",
66
- [{ id: "default", label: "Standard", isDefault: true }],
65
+ [
66
+ { id: "default", label: "Standard", isDefault: true },
67
+ { id: "priority", label: "Fast" },
68
+ ],
69
"default",
70
);
71
70
- expect(display([EFFORT, serviceTier], false).label).toBe("High");
72
+ expect(display([EFFORT, serviceTier])).toEqual({
73
+ label: "High",
74
+ showFastModeIcon: false,
75
+ });
76
+ expect(display([EFFORT, { ...serviceTier, currentValue: "priority" }])).toEqual({
77
+ label: "High",
78
+ showFastModeIcon: true,
79
+ });
80
});
81
82
it("keeps non-fastMode booleans as text labels", () => {
@@ -77,18 +86,18 @@ describe("buildTraitsTriggerDisplay", () => {
86
type: "boolean",
87
currentValue: true,
88
};
80
- expect(display([EFFORT, thinking], false)).toEqual({
89
+ expect(display([EFFORT, thinking])).toEqual({
90
label: "High · Thinking On",
91
showFastModeIcon: false,
92
});
93
});
94
95
it("falls back to a text label when fast mode is the only trait", () => {
87
- expect(display([fastModeDescriptor(true)], true)).toEqual({
96
+ expect(display([fastModeDescriptor(true)])).toEqual({
97
label: "Fast",
98
showFastModeIcon: false,
99
});
91
- expect(display([fastModeDescriptor(false)], false)).toEqual({
100
+ expect(display([fastModeDescriptor(false)])).toEqual({
101
label: "Normal",
102
showFastModeIcon: false,
103
});
@@ -107,7 +116,7 @@ describe("buildTraitsTriggerDisplay", () => {
116
{ id: "high", label: "High" },
117
],
118
};
110
- expect(display([unresolved], false)).toEqual({ label: "", showFastModeIcon: false });
119
+ expect(display([unresolved])).toEqual({ label: "", showFastModeIcon: false });
120
});
121
122
it("still renders the prompt-controlled ultrathink label alongside the bolt", () => {
@@ -117,7 +126,6 @@ describe("buildTraitsTriggerDisplay", () => {
126
descriptors: [EFFORT, fastModeDescriptor(true)],
127
primarySelectDescriptorId: "reasoningEffort",
128
ultrathinkPromptControlled: true,
120
- fastModeEnabled: true,
129
}),
130
).toEqual({ label: "Ultrathink", showFastModeIcon: true });
131
});
apps/web/src/components/chat/TraitsPicker.tsx
+10
-12
@@ -134,8 +134,6 @@ function getSelectedTraits(
134
: getDescriptorStringValue(primarySelectDescriptor)) ?? null;
135
const thinkingEnabled =
136
typeof thinkingDescriptor?.currentValue === "boolean" ? thinkingDescriptor.currentValue : null;
137
- const fastModeEnabled =
138
- typeof fastModeDescriptor?.currentValue === "boolean" ? fastModeDescriptor.currentValue : false;
137
const contextWindow = getDescriptorStringValue(contextWindowDescriptor);
138
const selectedAgent = getDescriptorStringValue(agentDescriptor);
139
const selectedAgentLabel = agentDescriptor
@@ -154,7 +152,6 @@ function getSelectedTraits(
152
thinkingDescriptor,
153
effort,
154
thinkingEnabled,
157
- fastModeEnabled,
155
contextWindow,
156
ultrathinkPromptControlled,
157
ultrathinkInBodyText,
@@ -392,24 +389,26 @@ export function buildTraitsTriggerDisplay(input: {
389
descriptors: ReadonlyArray<ProviderOptionDescriptor>;
390
primarySelectDescriptorId: string | null;
391
ultrathinkPromptControlled: boolean;
395
- fastModeEnabled: boolean;
392
}): { label: string; showFastModeIcon: boolean } {
393
let hasFastMode = false;
394
+ let fastModeEnabled = false;
395
const labels: Array<string> = [];
396
for (const descriptor of input.descriptors) {
397
if (descriptor.id === "fastMode" && descriptor.type === "boolean") {
398
hasFastMode = true;
399
+ fastModeEnabled = descriptor.currentValue === true;
400
continue;
401
}
402
if (
403
input.provider === "codex" &&
404
descriptor.id === "serviceTier" &&
407
- descriptor.type === "select" &&
408
- input.descriptors.some(({ id }) => id === "reasoningEffort")
405
+ descriptor.type === "select"
406
) {
407
const currentValue = getProviderOptionCurrentValue(descriptor);
411
- const currentOption = descriptor.options.find((option) => option.id === currentValue);
412
- if (currentOption?.id === "default" && currentOption.isDefault === true) {
408
+ const fastTier = descriptor.options.find(({ label }) => label === "Fast");
409
+ if (fastTier && (currentValue === "default" || currentValue === fastTier.id)) {
410
+ hasFastMode = true;
411
+ fastModeEnabled = currentValue === fastTier.id;
412
continue;
413
}
414
}
@@ -428,9 +427,9 @@ export function buildTraitsTriggerDisplay(input: {
427
// off an empty label list alone would also catch descriptors that resolved to
428
// no label at all, printing a bogus "Normal" for a model without fast mode.
429
if (labels.length === 0 && hasFastMode) {
431
- return { label: input.fastModeEnabled ? "Fast" : "Normal", showFastModeIcon: false };
430
+ return { label: fastModeEnabled ? "Fast" : "Normal", showFastModeIcon: false };
431
}
433
- return { label: labels.join(" · "), showFastModeIcon: input.fastModeEnabled };
432
+ return { label: labels.join(" · "), showFastModeIcon: fastModeEnabled };
433
}
434
435
export const TraitsPicker = memo(function TraitsPicker({
@@ -447,7 +446,7 @@ export const TraitsPicker = memo(function TraitsPicker({
446
...persistence
447
}: TraitsMenuContentProps & TraitsPersistence) {
448
const [isMenuOpen, setIsMenuOpen] = useState(false);
450
- const { descriptors, primarySelectDescriptor, ultrathinkPromptControlled, fastModeEnabled } =
449
+ const { descriptors, primarySelectDescriptor, ultrathinkPromptControlled } =
450
getTraitsSectionVisibility({
451
provider,
452
models,
@@ -474,7 +473,6 @@ export const TraitsPicker = memo(function TraitsPicker({
473
descriptors,
474
primarySelectDescriptorId: primarySelectDescriptor?.id ?? null,
475
ultrathinkPromptControlled,
477
- fastModeEnabled,
476
});
477
const fastModeIcon = showFastModeIcon ? (
478
<>