@devries-cameron20 / t3code Mirror · read-only / commits / 49f6cbacc4
Fork 0

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 22, 10:45 UTC

fix(server): searching delegate models no longer drops words found inside the provider name (#26502)

Co-authored-by: maria-rcks <maria@kuuro.net>

MINIT committed Oct 31, 2026 at 07:09 UTC 49f6cbacc4ef426383187836392868fbc9103f59
2 files changed +31 -8
apps/server/src/mcp/OrchestratorMcpService.test.ts
+14 -1
@@ -1303,6 +1303,7 @@ describe("OrchestratorMcpService provider resolution", () => {
1303 instanceId: codexInstanceId,
1304 driver: ProviderDriverKind.make("codex"),
1305 }),
1306 + displayName: "Codex",
1307 models: [
1308 model("gpt-6", {
1309 name: "Sol",
@@ -1330,7 +1331,7 @@ describe("OrchestratorMcpService provider resolution", () => {
1331 ],
1332 },
1333 }),
1333 - model("gpt-5", { isLegacy: true }),
1334 + model("gpt-5", { name: "Code Legacy", isLegacy: true }),
1335 model("gpt-4", { isLegacy: true }),
1336 model("gpt-3", { name: "GPT-3", isLegacy: true }),
1337 model("my-alpha", { isCustom: true }),
@@ -1436,6 +1437,18 @@ describe("OrchestratorMcpService provider resolution", () => {
1437 { id: codexInstanceId, models: ["gpt-6", "gpt-4", "gpt-3", "my-alpha"], omitted: 1 },
1438 { id: opencodeInstanceId, models: [], omitted: 0 },
1439 ]);
1440 + assert.deepEqual(listing(yield* capabilitiesWith(" ")), listing(yield* capabilitiesWith()));
1441 + for (const search of ["code", "codex code", " CODE "]) {
1442 + assert.deepEqual(listing(yield* capabilitiesWith(search))[0], {
1443 + id: codexInstanceId,
1444 + models: ["gpt-5"],
1445 + omitted: 0,
1446 + });
1447 + }
1448 + assert.deepEqual(
1449 + listing(yield* capabilitiesWith("open"))[1],
1450 + listing(yield* capabilitiesWith())[1],
1451 + );
1452 assert.deepEqual(listing(yield* capabilitiesWith("codex gpt 5"))[0], {
1453 id: codexInstanceId,
1454 models: ["gpt-5"],
apps/server/src/mcp/OrchestratorMcpService.ts
+17 -7
@@ -287,10 +287,8 @@ const FULL_CATALOG_DRIVERS: ReadonlySet<string> = new Set(["codex", "claudeAgent
287 const LISTED_MODEL_LIMIT = 8;
288
289 /**
290 - * Picks the models orchestrator_capabilities shows for one provider. Hidden models never
291 - * appear. Search words naming the provider are dropped; other words list matches. With no
292 - * words left, lists pinned models (custom, favorite, the caller's own) plus non-legacy
293 - * models, or only the first few in the user's model order for large catalogs.
290 + * Lists visible models, keeping pinned models and limiting large catalogs by default.
291 + * Whole provider words select the provider; partial words filter models when any match.
292 */
293 function listCapabilityModels(input: {
294 readonly provider: ServerProvider;
@@ -306,10 +304,22 @@ function listCapabilityModels(input: {
304 .toSorted((a, b) => (rank.get(a.slug) ?? rank.size) - (rank.get(b.slug) ?? rank.size));
305 const { instanceId, driver, displayName } = input.provider;
306 const providerText = `${instanceId} ${driver} ${displayName ?? ""}`.toLowerCase();
309 - const modelTerms = input.searchTerms.filter((term) => !providerText.includes(term));
307 + // Whole ids like "codex-work" and their parts both name the provider.
308 + const providerWords = new Set([
309 + ...providerText.split(/\s+/),
310 + ...providerText.split(/[^\p{L}\p{N}]+/u),
311 + ]);
312 + const modelText = (model: ServerProviderModel) =>
313 + `${model.slug} ${model.name} ${model.subProvider ?? ""}`.toLowerCase();
314 + // Part of a provider word ("agent" in "claudeAgent") names the provider unless a model matches it.
315 + const modelTerms = input.searchTerms.filter(
316 + (term) =>
317 + !providerWords.has(term) &&
318 + (!providerText.includes(term) || visible.some((model) => modelText(model).includes(term))),
319 + );
320 if (modelTerms.length > 0) {
321 const matches = visible.filter((model) => {
312 - const text = `${model.slug} ${model.name} ${model.subProvider ?? ""}`.toLowerCase();
322 + const text = modelText(model);
323 return modelTerms.every((term) => text.includes(term));
324 });
325 const listed = matches.slice(0, LISTED_MODEL_LIMIT);
@@ -2138,7 +2148,7 @@ const make = Effect.gen(function* () {
2148 Effect.mapError(() => failure("orchestration_error", "Unable to read server settings.")),
2149 );
2150 const inherited = parent?.thread.modelSelection;
2141 - const searchTerms = input.search?.toLowerCase().split(/\s+/) ?? [];
2151 + const searchTerms = input.search?.toLowerCase().split(/\s+/).filter(Boolean) ?? [];
2152 return {
2153 parentThreadId: parent?.thread.id ?? null,
2154 inheritedProviderInstanceId: inherited?.instanceId ?? null,