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 21, 09:45 UTC
fix(web): model picker lists a model reported twice once (#31590)
Julius Marminge committed
Nov 16, 2026 at 13:07 UTC
c69f4b780bdb3fd7b3d6a06f41b7017f77298c5e
2 files changed
+72
apps/web/src/components/chat/ModelPickerContent.tsx
+4
@@ -548,13 +548,16 @@ export const ModelPickerContent = memo(function ModelPickerContent(props: {
548
549
const flatModels = (() => {
550
const out: ModelPickerItem[] = [];
551
+ const seenKeys = new Set<string>();
552
for (const [instanceId, models] of modelOptionsByInstance) {
553
const entry = entryByInstanceId.get(instanceId);
554
if (!entry) {
555
continue;
556
}
557
for (const model of models) {
558
+ const key = modelPickerModelKey(instanceId, model.slug);
559
if (
560
+ seenKeys.has(key) ||
561
!shouldIncludeModelPickerOption({
562
entry,
563
option: model,
@@ -564,6 +567,7 @@ export const ModelPickerContent = memo(function ModelPickerContent(props: {
567
) {
568
continue;
569
}
570
+ seenKeys.add(key);
571
out.push({
572
slug: model.slug,
573
name: model.name,
apps/web/src/components/chat/ProviderModelPicker.browser.test.tsx
+68
@@ -4,6 +4,7 @@ import {
4
ProviderInstanceId,
5
type ModelSelection,
6
} from "@t3tools/contracts";
7
+import { compileResolvedKeybindingsConfig } from "@t3tools/shared/keybindings";
8
import { useState } from "react";
9
import { expect, it, vi } from "vite-plus/test";
10
import { page, userEvent } from "vite-plus/test/browser";
@@ -176,6 +177,73 @@ it("keeps a docked picker open after a pick and hands focus to that model's effo
177
await expect.element(search).not.toBeInTheDocument();
178
});
179
180
+it("lists a model reported twice by one provider once, with contiguous jump shortcuts", async () => {
181
+ const instanceId = ProviderInstanceId.make("claude");
182
+ const entries = deriveProviderInstanceEntries([
183
+ {
184
+ instanceId,
185
+ driver: ProviderDriverKind.make("claudeAgent"),
186
+ enabled: true,
187
+ installed: true,
188
+ version: null,
189
+ status: "ready",
190
+ auth: { status: "authenticated" },
191
+ checkedAt: "2026-01-01T00:00:00.000Z",
192
+ models: [],
193
+ slashCommands: [],
194
+ skills: [],
195
+ },
196
+ ]);
197
+ const options = new Map([
198
+ [
199
+ instanceId,
200
+ ["a", "b", "c", "c", "d", "d"].map((slug) => ({
201
+ slug,
202
+ name: `Model ${slug.toUpperCase()}`,
203
+ })),
204
+ ],
205
+ ]);
206
+ const keybindings = compileResolvedKeybindingsConfig(
207
+ ([1, 2, 3, 4, 5, 6] as const).map((index) => ({
208
+ key: `mod+${index}`,
209
+ command: `modelPicker.jump.${index}` as const,
210
+ when: "modelPickerOpen",
211
+ })),
212
+ );
213
+
214
+ await using screen = await render(
215
+ <ProviderModelPicker
216
+ environmentId={null}
217
+ activeInstanceId={instanceId}
218
+ model="a"
219
+ lockedProvider={null}
220
+ instanceEntries={entries}
221
+ modelOptionsByInstance={options}
222
+ keybindings={keybindings}
223
+ triggerAriaLabel="Choose model"
224
+ onInstanceModelChange={() => {}}
225
+ />,
226
+ );
227
+ await screen.getByRole("button", { name: "Choose model" }).click();
228
+ await expect.element(page.getByRole("option", { name: /Model A/ })).toBeVisible();
229
+ await vi.waitFor(() =>
230
+ expect(
231
+ page
232
+ .getByRole("option")
233
+ .elements()
234
+ .map((row) => [
235
+ row.textContent?.match(/Model [A-Z]/)?.[0],
236
+ row.querySelector("kbd")?.textContent?.slice(-1),
237
+ ]),
238
+ ).toEqual([
239
+ ["Model A", "1"],
240
+ ["Model B", "2"],
241
+ ["Model C", "3"],
242
+ ["Model D", "4"],
243
+ ]),
244
+ );
245
+});
246
+
247
it("opens on the active provider when every favorite belongs to a disabled provider", async () => {
248
const entries = deriveProviderInstanceEntries(
249
["Codex", "Claude"].map((name) => ({