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, 11:00 UTC
fix(server): delegate_task names the CLI version that hides a model (#37214)
Julius Marminge committed
Nov 15, 2026 at 05:42 UTC
9c1dfbb5aaf3aab1a64a6bb4a98e06ad87fbdb81
2 files changed
+28
-9
apps/server/src/mcp/OrchestratorMcpService.test.ts
+9
@@ -2512,6 +2512,10 @@ describe("OrchestratorMcpService provider resolution", () => {
2512
{ slug: "claude-opus-4-1", isLegacy: true },
2513
...Array.from({ length: 9 }, (_, index) => ({ slug: `claude-opus-5-${index + 1}` })),
2514
].map((model) => ({ ...model, name: model.slug, isCustom: false, capabilities: null })),
2515
+ version: "2.1.302",
2516
+ updateRequiredModels: [
2517
+ { slug: "claude-fable-5-2", name: "Claude Fable 5.2", minVersion: "2.1.321" },
2518
+ ],
2519
},
2520
]),
2521
adapterRegistryLayer([codexInstanceId]),
@@ -2549,6 +2553,11 @@ describe("OrchestratorMcpService provider resolution", () => {
2553
"claude-opus-5-6, claude-opus-5-7, claude-opus-5-8 and 2 more; " +
2554
"orchestrator_capabilities with search finds them.",
2555
);
2556
+
2557
+ const updateRequired = yield* refuse("claude-fable-5-2");
2558
+ assert.equal(updateRequired.code, "model_unavailable");
2559
+ assert.include(updateRequired.message, "v2.1.302");
2560
+ assert.include(updateRequired.message, "2.1.321");
2561
}).pipe(Effect.provide(layerOrchestratorService.pipe(Layer.provide(layerDependencies))));
2562
}),
2563
);
apps/server/src/mcp/OrchestratorMcpService.ts
+19
-9
@@ -395,16 +395,26 @@ const advertisedModel = (provider: ServerProvider, model: string) =>
395
candidate.aliases?.some((alias) => alias.toLowerCase() === model.toLowerCase()),
396
);
397
398
+const withV = (version: string) => (version.startsWith("v") ? version : `v${version}`);
399
+
400
/** A provider that lists no models accepts any slug. */
399
-export const requireAdvertisedModel = (provider: ServerProvider, model: string) =>
400
- provider.models.length > 0 && advertisedModel(provider, model) === undefined
401
- ? Effect.fail(
402
- failure(
403
- "model_unavailable",
404
- `Model ${model} is not advertised by provider ${provider.instanceId}. ${advertisedModelsHint(provider.models, model)}`,
405
- ),
406
- )
407
- : Effect.void;
401
+export const requireAdvertisedModel = (provider: ServerProvider, model: string) => {
402
+ if (provider.models.length === 0 || advertisedModel(provider, model) !== undefined) {
403
+ return Effect.void;
404
+ }
405
+ const updateRequired = provider.updateRequiredModels?.find(
406
+ (candidate) => candidate.slug === model,
407
+ );
408
+ const detectedVersion = provider.installedVersion ?? provider.version;
409
+ return Effect.fail(
410
+ failure(
411
+ "model_unavailable",
412
+ updateRequired === undefined
413
+ ? `Model ${model} is not advertised by provider ${provider.instanceId}. ${advertisedModelsHint(provider.models, model)}`
414
+ : `Model ${model} needs provider ${provider.instanceId} at ${withV(updateRequired.minVersion)} or newer, but the detected CLI is ${detectedVersion === null ? "an unknown version" : withV(detectedVersion)}. Ask the user to update it or point the provider's binary path at a newer install.`,
415
+ ),
416
+ );
417
+};
418
419
function providerConstraints(
420
provider: ServerProvider | undefined,