The best way to control Claude Code, Codex and more from any computer or phone
fix(web): re-picking the current model in Settings keeps its traits (#35612)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
F4llen committed
Nov 14, 2026 at 03:59 UTC
b4c1bd106d994c4c51cfa8b3a1999d3b11566c83
7 files changed
+63
-12
apps/web/src/components/settings/ProjectDefaultsSettings.tsx
+9
-3
@@ -4,7 +4,7 @@ import {
4
type WorktreeSubmodules,
5
managedRuntimeModeDenial,
6
} from "@t3tools/contracts";
7
-import { createModelSelection } from "@t3tools/shared/model";
7
+import { createModelSelection, pickModelSelection } from "@t3tools/shared/model";
8
import { resolveProjectSettings } from "@t3tools/shared/projectSettings";
9
import { useNavigate } from "@tanstack/react-router";
10
@@ -172,7 +172,7 @@ export function ProjectDefaultsSettings({ category }: { category: ProjectSetting
172
});
173
}}
174
onInstanceModelChange={(instanceId, model) =>
175
- setModel(createModelSelection(instanceId, model))
175
+ setModel(pickModelSelection(mixedModel ? null : selection, instanceId, model))
176
}
177
/>
178
{!mixedModel && !presentation.providerNote && !effortDisabledReason && activeEntry ? (
@@ -288,7 +288,13 @@ export function ProjectDefaultsSettings({ category }: { category: ProjectSetting
288
});
289
return;
290
}
291
- updateSettings({ fallbackModelSelection: createModelSelection(instanceId, model) });
291
+ updateSettings({
292
+ fallbackModelSelection: pickModelSelection(
293
+ mixedFallback ? null : settings.fallbackModelSelection,
294
+ instanceId,
295
+ model,
296
+ ),
297
+ });
298
}}
299
/>
300
{settings.fallbackModelSelection !== null && fallbackEntry && !mixedFallback ? (
apps/web/src/components/settings/SettingsPanels.tsx
+6
-2
@@ -27,7 +27,7 @@ import {
27
ToolCallVisibility,
28
} from "@t3tools/contracts/settings";
29
import { desktopUpdateChannelOf } from "@t3tools/shared/cliRelease";
30
-import { createModelSelection } from "@t3tools/shared/model";
30
+import { createModelSelection, pickModelSelection } from "@t3tools/shared/model";
31
import { resolvePastedPath } from "@t3tools/shared/path";
32
import * as Equal from "effect/Equal";
33
import * as Schema from "effect/Schema";
@@ -2046,7 +2046,11 @@ export function ThreadsSettingsPanel() {
2046
textGenerationModelSelection: resolveAppModelSelectionState(
2047
{
2048
...settings,
2049
- textGenerationModelSelection: createModelSelection(instanceId, model),
2049
+ textGenerationModelSelection: pickModelSelection(
2050
+ textGenerationModelSelection,
2051
+ instanceId,
2052
+ model,
2053
+ ),
2054
},
2055
textGenerationProviders,
2056
),
apps/web/src/components/settings/SourceControlWritingSettings.tsx
+11
-3
@@ -7,7 +7,7 @@ import {
7
textGeneratorForSelection,
8
} from "@t3tools/contracts";
9
import { DEFAULT_UNIFIED_SETTINGS } from "@t3tools/contracts/settings";
10
-import { createModelSelection } from "@t3tools/shared/model";
10
+import { createModelSelection, pickModelSelection } from "@t3tools/shared/model";
11
import {
12
resolveReviewGuideModelSelection,
13
resolveSourceControlWriterModelSelection,
@@ -365,7 +365,11 @@ export function SourceControlWritingSettingsSection() {
365
return;
366
}
367
updateSettings({
368
- reviewGuideModelSelection: createModelSelection(instanceId, model),
368
+ reviewGuideModelSelection: pickModelSelection(
369
+ mixedReviewGuideModel ? null : reviewGuideSelection,
370
+ instanceId,
371
+ model,
372
+ ),
373
});
374
}}
375
/>
@@ -564,7 +568,11 @@ export function SourceControlWritingSettingsSection() {
568
return;
569
}
570
updateSettings({
567
- sourceControlWriterModelSelection: createModelSelection(instanceId, model),
571
+ sourceControlWriterModelSelection: pickModelSelection(
572
+ mixedWriterModel ? null : activeSelection,
573
+ instanceId,
574
+ model,
575
+ ),
576
});
577
}}
578
/>
apps/web/src/components/settings/TextGeneratorsSettings.tsx
+2
-2
@@ -7,7 +7,7 @@ import {
7
TextGeneratorConfig,
8
type TextGeneratorModel,
9
} from "@t3tools/contracts";
10
-import { createModelSelection } from "@t3tools/shared/model";
10
+import { pickModelSelection } from "@t3tools/shared/model";
11
import { AsyncResult } from "effect/reactivity";
12
import * as Option from "effect/Option";
13
import * as Schema from "effect/Schema";
@@ -571,7 +571,7 @@ function TextGenerationTaskPicker({
571
)}
572
triggerClassName={SETTINGS_PICKER_TRIGGER_CLASSNAME}
573
onInstanceModelChange={(instanceId, model) =>
574
- updateSettings({ [settingKey]: createModelSelection(instanceId, model) })
574
+ updateSettings({ [settingKey]: pickModelSelection(selection, instanceId, model) })
575
}
576
/>
577
</div>
apps/web/src/components/settings/VoiceSettingsPanel.tsx
+2
-2
@@ -28,7 +28,7 @@ import {
28
type SpeechModelUnloadTimeout,
29
type VoiceShortcutMode,
30
} from "@t3tools/contracts";
31
-import { createModelSelection } from "@t3tools/shared/model";
31
+import { createModelSelection, pickModelSelection } from "@t3tools/shared/model";
32
import { resolveSpeechPostProcessingModelSelection } from "@t3tools/shared/serverSettings";
33
import { cloudSpeechLanguages } from "@t3tools/shared/speech";
34
import {
@@ -576,7 +576,7 @@ function CleanupModelRow() {
576
triggerClassName={SETTINGS_PICKER_TRIGGER_CLASSNAME}
577
getModelDisabledReason={modelDisabledReason}
578
onInstanceModelChange={(instanceId, model) =>
579
- setModel(createModelSelection(instanceId, model))
579
+ setModel(pickModelSelection(selection, instanceId, model))
580
}
581
/>
582
<TraitsPicker
packages/shared/src/model.test.ts
+22
@@ -11,6 +11,7 @@ import {
11
getProviderOptionDescriptors,
12
readCustomModelEntries,
13
modelSelectionsEqual,
14
+ pickModelSelection,
15
withImplicitFastModeDefault,
16
} from "./model.ts";
17
@@ -99,6 +100,27 @@ describe("descriptor helpers", () => {
100
).toBe(false);
101
expect(modelSelectionsEqual(left, { ...reordered, model: "gpt-5.5" })).toBe(false);
102
});
103
+
104
+ it("keeps the options when the current model is picked again", () => {
105
+ const codex = ProviderInstanceId.make("codex");
106
+ const current = createModelSelection(codex, "gpt-5.4", [
107
+ { id: "reasoningEffort", value: "high" },
108
+ ]);
109
+
110
+ expect(pickModelSelection(current, codex, "gpt-5.4")).toBe(current);
111
+ expect(pickModelSelection(current, codex, "gpt-5.5")).toEqual({
112
+ instanceId: "codex",
113
+ model: "gpt-5.5",
114
+ });
115
+ expect(pickModelSelection(current, ProviderInstanceId.make("codex_work"), "gpt-5.4")).toEqual({
116
+ instanceId: "codex_work",
117
+ model: "gpt-5.4",
118
+ });
119
+ expect(pickModelSelection(null, codex, "gpt-5.4")).toEqual({
120
+ instanceId: "codex",
121
+ model: "gpt-5.4",
122
+ });
123
+ });
124
});
125
126
describe("applyClaudePromptEffortPrefix", () => {
packages/shared/src/model.ts
+11
@@ -538,6 +538,17 @@ export function createModelSelection(
538
return selections.length > 0 ? { ...base, options: selections } : base;
539
}
540
541
+/** A model picker's pick: re-picking the current model keeps its options, another model starts without any. */
542
+export function pickModelSelection(
543
+ current: ModelSelection | null | undefined,
544
+ instanceId: ProviderInstanceId,
545
+ model: string,
546
+): ModelSelection {
547
+ return current?.instanceId === instanceId && current.model === model
548
+ ? current
549
+ : createModelSelection(instanceId, model);
550
+}
551
+
552
export function resolvePromptInjectedEffort(
553
caps: ModelCapabilities,
554
rawEffort: string | null | undefined,