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 23, 05:30 UTC
fix(web): the model picker offers every saved custom model, not just the first 32 (#14961)
tiliakoos committed
Oct 18, 2026 at 14:45 UTC
b5b6c8cf4c00873c15e26fea4973138a755e84ae
2 files changed
+33
-4
apps/web/src/modelSelection.test.ts
+33
@@ -187,6 +187,39 @@ describe("instance-scoped model selection", () => {
187
);
188
});
189
190
+ it("offers and resolves every saved custom model, past the first 32", () => {
191
+ const providers = [
192
+ provider({
193
+ provider: ProviderDriverKind.make("claudeAgent"),
194
+ instanceId: "claude_openrouter",
195
+ }),
196
+ ];
197
+ const customModels = Array.from({ length: 40 }, (_, index) => `proxy/model-${index + 1}`);
198
+ const settings: UnifiedSettings = {
199
+ ...settingsWithProviderInstances(),
200
+ providerInstances: {
201
+ ...settingsWithProviderInstances().providerInstances,
202
+ [ProviderInstanceId.make("claude_openrouter")]: {
203
+ driver: ProviderDriverKind.make("claudeAgent"),
204
+ config: { customModels },
205
+ },
206
+ },
207
+ };
208
+ const openrouter = deriveProviderInstanceEntries(providers)[0]!;
209
+
210
+ expect(
211
+ getAppModelOptionsForInstance(settings, openrouter).map((option) => option.slug),
212
+ ).toEqual(customModels);
213
+ expect(
214
+ resolveAppModelSelectionForInstance(
215
+ ProviderInstanceId.make("claude_openrouter"),
216
+ settings,
217
+ providers,
218
+ "proxy/model-40",
219
+ ),
220
+ ).toBe("proxy/model-40");
221
+ });
222
+
223
it("does not inject an unknown selected slug into the stock instance list", () => {
224
const providers = [
225
provider({
apps/web/src/modelSelection.ts
-4
@@ -32,7 +32,6 @@ import {
32
} from "./providerInstances";
33
import { sortModelsForProviderInstance } from "./modelOrdering";
34
35
-const MAX_CUSTOM_MODEL_COUNT = 32;
35
export const MAX_CUSTOM_MODEL_LENGTH = 256;
36
const DEFAULT_TEXT_GENERATION_INSTANCE_ID = ProviderInstanceId.make("codex");
37
@@ -149,9 +148,6 @@ function normalizeCustomModelEntries(
148
149
seen.add(candidate.slug);
150
normalizedModels.push(candidate);
152
- if (normalizedModels.length >= MAX_CUSTOM_MODEL_COUNT) {
153
- break;
154
- }
151
}
152
153
return normalizedModels;