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

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

fix(composer): hide default Codex service tier (#4784)

Max Katz committed Jul 30, 2026 at 06:35 UTC b125b7635170ec0c33f8ddf39299155a21f8c9b9
2 files changed +33 -5
apps/web/src/components/chat/TraitsPicker.test.ts
+19 -5
@@ -1,10 +1,10 @@
1 import { describe, expect, it } from "vite-plus/test";
2 -import type { ProviderOptionDescriptor } from "@t3tools/contracts";
2 +import { ProviderDriverKind, type ProviderOptionDescriptor } from "@t3tools/contracts";
3 import { buildTraitsTriggerDisplay } from "./TraitsPicker";
4
5 function selectDescriptor(
6 id: string,
7 - options: ReadonlyArray<{ id: string; label: string }>,
7 + options: ReadonlyArray<{ id: string; label: string; isDefault?: boolean }>,
8 currentValue: string,
9 ): Extract<ProviderOptionDescriptor, { type: "select" }> {
10 return { id, label: id, type: "select", options: [...options], currentValue };
@@ -17,7 +17,7 @@ function fastModeDescriptor(
17 }
18
19 const EFFORT = selectDescriptor(
20 - "effort",
20 + "reasoningEffort",
21 [
22 { id: "high", label: "High" },
23 { id: "max", label: "Max" },
@@ -33,10 +33,13 @@ const CONTEXT_WINDOW = selectDescriptor(
33 "1m",
34 );
35
36 +const CODEX = ProviderDriverKind.make("codex");
37 +
38 function display(descriptors: ReadonlyArray<ProviderOptionDescriptor>, fastModeEnabled: boolean) {
39 return buildTraitsTriggerDisplay({
40 + provider: CODEX,
41 descriptors,
39 - primarySelectDescriptorId: "effort",
42 + primarySelectDescriptorId: "reasoningEffort",
43 ultrathinkPromptControlled: false,
44 fastModeEnabled,
45 });
@@ -57,6 +60,16 @@ describe("buildTraitsTriggerDisplay", () => {
60 });
61 });
62
63 + it("omits Codex's default Standard tier beside reasoning", () => {
64 + const serviceTier = selectDescriptor(
65 + "serviceTier",
66 + [{ id: "default", label: "Standard", isDefault: true }],
67 + "default",
68 + );
69 +
70 + expect(display([EFFORT, serviceTier], false).label).toBe("High");
71 + });
72 +
73 it("keeps non-fastMode booleans as text labels", () => {
74 const thinking: Extract<ProviderOptionDescriptor, { type: "boolean" }> = {
75 id: "thinking",
@@ -100,8 +113,9 @@ describe("buildTraitsTriggerDisplay", () => {
113 it("still renders the prompt-controlled ultrathink label alongside the bolt", () => {
114 expect(
115 buildTraitsTriggerDisplay({
116 + provider: CODEX,
117 descriptors: [EFFORT, fastModeDescriptor(true)],
104 - primarySelectDescriptorId: "effort",
118 + primarySelectDescriptorId: "reasoningEffort",
119 ultrathinkPromptControlled: true,
120 fastModeEnabled: true,
121 }),
apps/web/src/components/chat/TraitsPicker.tsx
+14
@@ -388,6 +388,7 @@ export const TraitsMenuContent = memo(function TraitsMenuContentImpl({
388 * chevron) would leave the trigger unreadable.
389 */
390 export function buildTraitsTriggerDisplay(input: {
391 + provider: ProviderDriverKind;
392 descriptors: ReadonlyArray<ProviderOptionDescriptor>;
393 primarySelectDescriptorId: string | null;
394 ultrathinkPromptControlled: boolean;
@@ -400,6 +401,18 @@ export function buildTraitsTriggerDisplay(input: {
401 hasFastMode = true;
402 continue;
403 }
404 + if (
405 + input.provider === "codex" &&
406 + descriptor.id === "serviceTier" &&
407 + descriptor.type === "select" &&
408 + input.descriptors.some(({ id }) => id === "reasoningEffort")
409 + ) {
410 + const currentValue = getProviderOptionCurrentValue(descriptor);
411 + const currentOption = descriptor.options.find((option) => option.id === currentValue);
412 + if (currentOption?.id === "default" && currentOption.isDefault === true) {
413 + continue;
414 + }
415 + }
416 const label =
417 input.ultrathinkPromptControlled && descriptor.id === input.primarySelectDescriptorId
418 ? "Ultrathink"
@@ -457,6 +470,7 @@ export const TraitsPicker = memo(function TraitsPicker({
470 }
471
472 const { label: triggerLabel, showFastModeIcon } = buildTraitsTriggerDisplay({
473 + provider,
474 descriptors,
475 primarySelectDescriptorId: primarySelectDescriptor?.id ?? null,
476 ultrathinkPromptControlled,