@devries-cameron20 / t3code-1 / commits / 680152e27b
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): agents get a short, current model list instead of a 55k-character catalog dump (#22889)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Theo Browne committed Oct 21, 2026 at 06:40 UTC 680152e27b2a961686389ca69a1557cbb2c55f08
11 files changed +440 -56
apps/server/src/mcp/OrchestratorMcpService.test.ts
+171
@@ -5,6 +5,7 @@ import {
5 EnvironmentId,
6 MessageId,
7 NodeId,
8 + type OrchestratorMcpCapabilitiesResult,
9 OrchestratorMcpTarget,
10 type OrchestrationV2ThreadShell,
11 type ScheduledTask,
@@ -1156,6 +1157,176 @@ describe("OrchestratorMcpService provider resolution", () => {
1157 }),
1158 );
1159
1160 + describe("listed models", () => {
1161 + const opencodeInstanceId = ProviderInstanceId.make("opencode");
1162 + const model = (slug: string, extra: Partial<ServerProvider["models"][number]> = {}) => ({
1163 + slug,
1164 + name: slug,
1165 + isCustom: false,
1166 + capabilities: null,
1167 + ...extra,
1168 + });
1169 + const opencodeSlugs = Array.from(
1170 + { length: 12 },
1171 + (_, index) => `oc/m${String(index + 1).padStart(2, "0")}`,
1172 + );
1173 + const catalog: ReadonlyArray<ServerProvider> = [
1174 + {
1175 + ...providerSnapshot({
1176 + instanceId: codexInstanceId,
1177 + driver: ProviderDriverKind.make("codex"),
1178 + }),
1179 + models: [
1180 + model("gpt-6", {
1181 + name: "Sol",
1182 + capabilities: {
1183 + optionDescriptors: [
1184 + {
1185 + id: "effort",
1186 + label: "Reasoning",
1187 + description: "How hard the model thinks.",
1188 + type: "select",
1189 + options: [
1190 + { id: "low", label: "Low", description: "Fast." },
1191 + { id: "high", label: "High", isDefault: true },
1192 + ],
1193 + promptInjectedValues: ["high"],
1194 + },
1195 + { id: "fastMode", label: "Fast", type: "boolean" },
1196 + {
1197 + id: "agent",
1198 + label: "Agent",
1199 + type: "select",
1200 + options: [{ id: "build", label: "Build" }],
1201 + currentValue: "build",
1202 + },
1203 + ],
1204 + },
1205 + }),
1206 + model("gpt-5", { isLegacy: true }),
1207 + model("gpt-4", { isLegacy: true }),
1208 + model("gpt-3", { name: "GPT-3", isLegacy: true }),
1209 + model("my-alpha", { isCustom: true }),
1210 + ],
1211 + },
1212 + {
1213 + ...providerSnapshot({
1214 + instanceId: opencodeInstanceId,
1215 + driver: ProviderDriverKind.make("opencode"),
1216 + }),
1217 + models: [
1218 + ...opencodeSlugs.map((slug) => model(slug, { isLegacy: slug === "oc/m03" })),
1219 + model("oc-custom", { isCustom: true }),
1220 + ],
1221 + },
1222 + ];
1223 +
1224 + const capabilitiesWith = (search?: string) =>
1225 + Effect.gen(function* () {
1226 + const service = yield* OrchestratorMcpService.OrchestratorMcpService;
1227 + return yield* service.capabilities(scope, search === undefined ? {} : { search });
1228 + }).pipe(
1229 + Effect.provide(
1230 + layerOrchestratorService.pipe(
1231 + Layer.provide(
1232 + Layer.mergeAll(
1233 + NodeServices.layer,
1234 + Layer.mock(ThreadManagementService.ThreadManagementService)({
1235 + getThreadRecords: () =>
1236 + Effect.succeed(
1237 + parentProjection([], { instanceId: codexInstanceId, model: "gpt-3" }),
1238 + ),
1239 + }),
1240 + ServerSettings.layerTest({
1241 + favorites: [
1242 + { provider: codexInstanceId, model: "gpt-4" },
1243 + { provider: opencodeInstanceId, model: "oc/m10" },
1244 + ],
1245 + providerModelPreferences: {
1246 + [opencodeInstanceId]: { hiddenModels: ["oc/m02"], modelOrder: ["oc/m12"] },
1247 + },
1248 + }),
1249 + providerRegistryLayer(catalog),
1250 + adapterRegistryLayer([codexInstanceId, opencodeInstanceId]),
1251 + Layer.mock(ProjectService.ProjectService)({}),
1252 + Layer.mock(SecretRequests.SecretRequests)({}),
1253 + Layer.mock(ScheduledTaskService.ScheduledTaskService)({}),
1254 + ),
1255 + ),
1256 + ),
1257 + ),
1258 + );
1259 +
1260 + const listing = (capabilities: OrchestratorMcpCapabilitiesResult) =>
1261 + capabilities.providers.map((provider) => ({
1262 + id: provider.providerInstanceId,
1263 + models: provider.models.map((entry) => entry.id),
1264 + omitted: provider.omittedModels ?? 0,
1265 + }));
1266 +
1267 + it.effect(
1268 + "skips legacy models, lists the first 8 of large catalogs, and keeps pinned models",
1269 + () =>
1270 + Effect.gen(function* () {
1271 + assert.deepEqual(listing(yield* capabilitiesWith()), [
1272 + // gpt-4 is a favorite and gpt-3 is the caller's model; legacy gpt-5 is left out.
1273 + { id: codexInstanceId, models: ["gpt-6", "gpt-4", "gpt-3", "my-alpha"], omitted: 1 },
1274 + {
1275 + id: opencodeInstanceId,
1276 + models: [
1277 + "oc/m12",
1278 + "oc/m01",
1279 + "oc/m04",
1280 + "oc/m05",
1281 + "oc/m06",
1282 + "oc/m07",
1283 + "oc/m08",
1284 + "oc/m09",
1285 + "oc/m10",
1286 + "oc-custom",
1287 + ],
1288 + omitted: 2,
1289 + },
1290 + ]);
1291 + }),
1292 + );
1293 +
1294 + it.effect("search matches every word and caps each provider's matches", () =>
1295 + Effect.gen(function* () {
1296 + assert.deepEqual(listing(yield* capabilitiesWith("GPT 5")), [
1297 + { id: codexInstanceId, models: ["gpt-5"], omitted: 0 },
1298 + { id: opencodeInstanceId, models: [], omitted: 0 },
1299 + ]);
1300 + const opencode = listing(yield* capabilitiesWith("oc/m"))[1];
1301 + assert.deepEqual(opencode, {
1302 + id: opencodeInstanceId,
1303 + models: ["oc/m12", "oc/m01", "oc/m03", "oc/m04", "oc/m05", "oc/m06", "oc/m07", "oc/m08"],
1304 + omitted: 3,
1305 + });
1306 + }),
1307 + );
1308 +
1309 + it.effect("describes models by id, distinct label, and option values", () =>
1310 + Effect.gen(function* () {
1311 + const codex = (yield* capabilitiesWith()).providers[0];
1312 + assert.deepEqual(codex?.models.slice(0, 4), [
1313 + {
1314 + id: "gpt-6",
1315 + label: "Sol",
1316 + options: [
1317 + { id: "effort", values: ["low", "high"], default: "high" },
1318 + { id: "fastMode", values: [false, true] },
1319 + { id: "agent", values: ["build"], default: "build" },
1320 + ],
1321 + },
1322 + { id: "gpt-4" },
1323 + { id: "gpt-3" },
1324 + { id: "my-alpha" },
1325 + ]);
1326 + }),
1327 + );
1328 + });
1329 +
1330 it.effect("rejects delegation to a provider without a registered adapter", () =>
1331 Effect.gen(function* () {
1332 const forkOnlyInstanceId = ProviderInstanceId.make("forkOnly");
apps/server/src/mcp/OrchestratorMcpService.ts
+91 -21
@@ -13,7 +13,9 @@ import {
13 type OrchestrationV2ThreadLaunchWorkspaceStrategy,
14 type OrchestrationV2TurnItem,
15 OrchestratorMcpFailure,
16 + type OrchestratorMcpCapabilitiesInput,
17 type OrchestratorMcpCapabilitiesResult,
18 + type OrchestratorMcpModelOption,
19 type OrchestratorMcpCreateThreadsInput,
20 type OrchestratorMcpCreateThreadsResult,
21 type OrchestratorMcpCreatedThread,
@@ -59,9 +61,11 @@ import {
61 type ScheduledTask,
62 type ScheduledTaskUpsertInput,
63 type ServerProvider,
64 + type ServerProviderModel,
65 ThreadId,
66 isOrchestrationV2WorkActive,
67 } from "@t3tools/contracts";
68 +import { getProviderOptionCurrentValue } from "@t3tools/shared/model";
69 import { runRanAfter } from "@t3tools/shared/orchestrationV2ThreadError";
70 import {
71 normalizeThreadPullRequestKey,
@@ -136,6 +140,7 @@ type TerminalTaskStatus = Extract<
140 export interface OrchestratorMcpServiceShape {
141 readonly capabilities: (
142 scope: McpInvocationScope,
143 + input?: OrchestratorMcpCapabilitiesInput,
144 ) => Effect.Effect<OrchestratorMcpCapabilitiesResult, OrchestratorMcpFailure>;
145 readonly delegateTask: (
146 scope: McpInvocationScope,
@@ -303,6 +308,61 @@ function scheduledTaskSummary(task: ScheduledTask, mayRun: boolean): Orchestrato
308 };
309 }
310
311 +/**
312 + * Large catalogs (OpenCode, Cursor, Pi) can list hundreds of models, so agents
313 + * get a short list by default and search for the rest. These providers have
314 + * small official catalogs, so all their current models are listed.
315 + */
316 +const FULL_CATALOG_DRIVERS: ReadonlySet<string> = new Set(["codex", "claudeAgent", "muse", "grok"]);
317 +const LISTED_MODEL_LIMIT = 8;
318 +
319 +/**
320 + * Picks the models orchestrator_capabilities shows for one provider. Hidden
321 + * models never appear. With search terms, lists matches; otherwise lists pinned
322 + * models (custom, favorite, the caller's own) plus the provider's non-legacy
323 + * models, or only the first few in the user's model order for large catalogs.
324 + */
325 +function listCapabilityModels(input: {
326 + readonly provider: ServerProvider;
327 + readonly preferences:
328 + | { readonly hiddenModels: ReadonlyArray<string>; readonly modelOrder: ReadonlyArray<string> }
329 + | undefined;
330 + readonly isPinned: (model: ServerProviderModel) => boolean;
331 + readonly searchTerms: ReadonlyArray<string>;
332 +}) {
333 + const rank = new Map(input.preferences?.modelOrder.map((slug, index) => [slug, index]));
334 + const visible = input.provider.models
335 + .filter((model) => model.isCustom || !input.preferences?.hiddenModels.includes(model.slug))
336 + .toSorted((a, b) => (rank.get(a.slug) ?? rank.size) - (rank.get(b.slug) ?? rank.size));
337 + if (input.searchTerms.length > 0) {
338 + const matches = visible.filter((model) => {
339 + const text = `${model.slug} ${model.name} ${model.subProvider ?? ""}`.toLowerCase();
340 + return input.searchTerms.every((term) => text.includes(term));
341 + });
342 + const listed = matches.slice(0, LISTED_MODEL_LIMIT);
343 + return { listed, omitted: matches.length - listed.length };
344 + }
345 + const current = visible.filter((model) => !model.isLegacy);
346 + const shown = new Set(
347 + FULL_CATALOG_DRIVERS.has(input.provider.driver)
348 + ? current
349 + : current.slice(0, LISTED_MODEL_LIMIT),
350 + );
351 + const listed = visible.filter((model) => input.isPinned(model) || shown.has(model));
352 + return { listed, omitted: visible.length - listed.length };
353 +}
354 +
355 +/** Option ids and allowed values are all a delegating agent needs; labels are UI copy. */
356 +function capabilityModelOption(descriptor: ProviderOptionDescriptor): OrchestratorMcpModelOption {
357 + const defaultValue = getProviderOptionCurrentValue(descriptor);
358 + return {
359 + id: descriptor.id,
360 + values:
361 + descriptor.type === "boolean" ? [false, true] : descriptor.options.map((choice) => choice.id),
362 + ...(defaultValue === undefined ? {} : { default: defaultValue }),
363 + };
364 +}
365 +
366 function providerConstraints(
367 provider: ServerProvider | undefined,
368 supportsOrchestrationV2: boolean,
@@ -2011,19 +2071,20 @@ const make = Effect.gen(function* () {
2071 return { status, secretRef: secretRef.value };
2072 }),
2073
2014 - capabilities: Effect.fn("OrchestratorMcpService.capabilities")(function* (scope) {
2074 + capabilities: Effect.fn("OrchestratorMcpService.capabilities")(function* (scope, input = {}) {
2075 const { parent, limits } = yield* loadCaller(scope);
2076 const providers = yield* loadProviders;
2077 const orchestrationCapableInstanceIds = yield* loadOrchestrationCapableInstanceIds();
2018 - const modelPreferences = yield* serverSettings.getSettings.pipe(
2019 - Effect.map((settings) => settings.providerModelPreferences ?? {}),
2078 + const settings = yield* serverSettings.getSettings.pipe(
2079 Effect.mapError(() => failure("orchestration_error", "Unable to read server settings.")),
2080 );
2081 + const inherited = parent?.thread.modelSelection;
2082 + const searchTerms = input.search?.toLowerCase().split(/\s+/) ?? [];
2083 return {
2084 parentThreadId: parent?.thread.id ?? null,
2024 - inheritedProviderInstanceId: parent?.thread.modelSelection.instanceId ?? null,
2025 - inheritedModel: parent?.thread.modelSelection.model ?? null,
2026 - inheritedOptions: parent?.thread.modelSelection.options ?? [],
2085 + inheritedProviderInstanceId: inherited?.instanceId ?? null,
2086 + inheritedModel: inherited?.model ?? null,
2087 + inheritedOptions: inherited?.options ?? [],
2088 runtimeMode: limits.runtimeMode,
2089 interactionMode: limits.interactionMode,
2090 providers: providers.map((provider) => {
@@ -2031,24 +2092,33 @@ const make = Effect.gen(function* () {
2092 provider,
2093 orchestrationCapableInstanceIds.has(provider.instanceId),
2094 );
2095 + const { listed, omitted } = listCapabilityModels({
2096 + provider,
2097 + preferences: settings.providerModelPreferences?.[provider.instanceId],
2098 + searchTerms,
2099 + isPinned: (model) =>
2100 + model.isCustom ||
2101 + (inherited?.instanceId === provider.instanceId && inherited.model === model.slug) ||
2102 + (settings.favorites ?? []).some(
2103 + (favorite) =>
2104 + favorite.provider === provider.instanceId && favorite.model === model.slug,
2105 + ),
2106 + });
2107 return {
2108 providerInstanceId: provider.instanceId,
2109 driverKind: provider.driver,
2037 - displayName: provider?.displayName ?? null,
2038 - models:
2039 - provider?.models
2040 - .filter(
2041 - (model) =>
2042 - model.isCustom ||
2043 - !modelPreferences[provider.instanceId]?.hiddenModels.includes(model.slug),
2044 - )
2045 - .map((model) => ({
2046 - id: model.slug,
2047 - label: model.name ?? null,
2048 - ...(model.capabilities?.optionDescriptors === undefined
2049 - ? {}
2050 - : { options: model.capabilities.optionDescriptors }),
2051 - })) ?? [],
2110 + displayName: provider.displayName ?? null,
2111 + models: listed.map((model) => {
2112 + const options = model.capabilities?.optionDescriptors ?? [];
2113 + return {
2114 + id: model.slug,
2115 + ...(model.name.toLowerCase() === model.slug.toLowerCase()
2116 + ? {}
2117 + : { label: model.name }),
2118 + ...(options.length === 0 ? {} : { options: options.map(capabilityModelOption) }),
2119 + };
2120 + }),
2121 + ...(omitted === 0 ? {} : { omittedModels: omitted }),
2122 ...(provider.supportedRuntimeModes === undefined ||
2123 provider.supportedRuntimeModes.length === 0
2124 ? {}
apps/server/src/mcp/toolkits/orchestrator/handlers.ts
+2 -2
@@ -9,11 +9,11 @@ import * as OrchestratorMcpService from "../../OrchestratorMcpService.ts";
9 import * as ThreadMetadataMcpService from "../../ThreadMetadataMcpService.ts";
10
11 const handlers = {
12 - orchestrator_capabilities: McpToolAccess.reads(() =>
12 + orchestrator_capabilities: McpToolAccess.reads((input) =>
13 Effect.gen(function* () {
14 const scope = yield* McpInvocationContext.McpInvocationContext;
15 const service = yield* OrchestratorMcpService.OrchestratorMcpService;
16 - return yield* service.capabilities(scope);
16 + return yield* service.capabilities(scope, input);
17 }),
18 ),
19 delegate_task: McpToolAccess.actsAsCaller((input) =>
apps/server/src/mcp/toolkits/orchestrator/tools.ts
+3 -1
@@ -1,4 +1,5 @@
1 import {
2 + OrchestratorMcpCapabilitiesInput,
3 OrchestratorMcpCapabilitiesResult,
4 OrchestrationV2StopWorkflowInput,
5 OrchestratorMcpCreateThreadsInput,
@@ -52,7 +53,8 @@ const threadMetadataDependencies = [
53
54 const OrchestratorCapabilitiesTool = Tool.make("orchestrator_capabilities", {
55 description:
55 - "List the V2 provider instances and their current models from the same live catalog as the composer, including configured custom models, inherited runtime settings, and app-owned orchestration features available to this caller. For a separate top-level thread in a new or existing worktree, use t3_thread_launch with workspaceStrategy.",
56 + "List the V2 provider instances, a short list of their models from the same live catalog as the composer, inherited runtime settings, and app-owned orchestration features available to this caller. The list has the user's favorite and custom models, your own model, every current Codex, Claude, Muse and Grok model, and the first 8 current models of other providers. Other legacy models are left out. omittedModels counts models left out; pass search, such as 'sonnet 4.6', to find them. delegate_task accepts any catalog model, listed or not. For a separate top-level thread in a new or existing worktree, use t3_thread_launch with workspaceStrategy.",
57 + parameters: OrchestratorMcpCapabilitiesInput,
58 success: OrchestratorMcpCapabilitiesResult,
59 failure: OrchestratorMcpFailure,
60 failureMode: "return",
apps/server/src/provider/model-manifest.json
+4 -2
@@ -1,6 +1,6 @@
1 {
2 "version": 1,
3 - "updatedAt": "2026-10-19T07:21:38Z",
3 + "updatedAt": "2026-10-21T06:20:00Z",
4 "compatibility": [
5 {
6 "driver": "codex",
@@ -134,7 +134,9 @@
134 { "slug": "gpt-5.6-sol", "name": "GPT-5.6 Sol", "status": "legacy" },
135 { "slug": "gpt-5.6-terra", "name": "GPT-5.6 Terra", "status": "legacy" },
136 { "slug": "gpt-5.6-luna", "name": "GPT-5.6 Luna", "status": "legacy" },
137 - { "slug": "gpt-5.5", "name": "GPT-5.5", "status": "legacy" }
137 + { "slug": "gpt-5.5", "name": "GPT-5.5", "status": "legacy" },
138 + { "slug": "gpt-5.4-mini", "name": "GPT-5.4 Mini", "status": "legacy" },
139 + { "slug": "gpt-5.3-codex-spark", "name": "GPT-5.3 Codex Spark", "status": "legacy" }
140 ]
141 },
142 "claudeAgent": {
docs/orchestration-v2/orchestrator-mcp-server.md
+8
@@ -207,6 +207,14 @@ Returns:
207 Unavailable providers include model-visible constraints such as missing V2
208 adapter support, disabled state, missing executable, or missing authentication.
209
210 +The model list is short on purpose: catalogs such as OpenCode can hold hundreds
211 +of models, and every call lands in the agent's context. Each provider lists
212 +custom, favorite, and the caller's own models, plus all current (non-legacy)
213 +models for Codex, Claude, Muse, and Grok, or the first 8 current models in the
214 +user's model order for other providers. `omittedModels` counts the rest, and the
215 +`search` input finds them, legacy models included. `delegate_task` still accepts
216 +any catalog model.
217 +
218 ### `delegate_task`
219
220 Creates a T3-owned child thread and immediately dispatches the supplied task
packages/contracts/src/orchestratorMcp.ts
+23 -7
@@ -37,11 +37,7 @@ import {
37 OrchestrationV2RunStatus,
38 OrchestrationV2TurnItemStatus,
39 } from "./orchestrationV2.ts";
40 -import {
41 - ProviderOptionDescriptor,
42 - ProviderOptionSelection,
43 - ProviderOptionSelectionValue,
44 -} from "./model.ts";
40 +import { ProviderOptionSelection, ProviderOptionSelectionValue } from "./model.ts";
41 import { ProviderDriverKind, ProviderInstanceId } from "./providerInstance.ts";
42
43 const OrchestratorMcpPrompt = TrimmedNonEmptyString.check(Schema.isMaxLength(120_000)).annotate({
@@ -507,6 +503,23 @@ export const OrchestratorMcpThreadInterruptResult = Schema.Struct({
503 });
504 export type OrchestratorMcpThreadInterruptResult = typeof OrchestratorMcpThreadInterruptResult.Type;
505
506 +export const OrchestratorMcpCapabilitiesInput = Schema.Struct({
507 + search: Schema.optional(
508 + TrimmedNonEmptyString.check(Schema.isMaxLength(200)).annotate({
509 + description:
510 + "Words to match against model ids and labels. Lists matching models instead of the default short list.",
511 + }),
512 + ),
513 +});
514 +export type OrchestratorMcpCapabilitiesInput = typeof OrchestratorMcpCapabilitiesInput.Type;
515 +
516 +export const OrchestratorMcpModelOption = Schema.Struct({
517 + id: Schema.String,
518 + values: Schema.Array(ProviderOptionSelectionValue),
519 + default: Schema.optional(ProviderOptionSelectionValue),
520 +});
521 +export type OrchestratorMcpModelOption = typeof OrchestratorMcpModelOption.Type;
522 +
523 export const OrchestratorMcpProviderCapability = Schema.Struct({
524 providerInstanceId: ProviderInstanceId,
525 driverKind: ProviderDriverKind,
@@ -514,10 +527,13 @@ export const OrchestratorMcpProviderCapability = Schema.Struct({
527 models: Schema.Array(
528 Schema.Struct({
529 id: Schema.String,
517 - label: Schema.NullOr(Schema.String),
518 - options: Schema.optional(Schema.Array(ProviderOptionDescriptor)),
530 + /** Omitted when it only restates the id. */
531 + label: Schema.optional(Schema.String),
532 + options: Schema.optional(Schema.Array(OrchestratorMcpModelOption)),
533 }),
534 ),
535 + /** Models left out of `models`: unlisted visible models, or matches past the cap with `search`. */
536 + omittedModels: Schema.optional(NonNegativeInt),
537 runtimeModes: Schema.optional(Schema.Array(RuntimeMode)),
538 canRunChildTask: Schema.Boolean,
539 canRunCrossProviderChildTask: Schema.Boolean,
packages/provider-core/src/server/orchestrationInstructions.ts
+1 -1
@@ -10,7 +10,7 @@ export const T3_CODE_ORCHESTRATION_SECTIONS: ReadonlyArray<string> = [
10
11 The \`t3-code\` MCP server provides app-owned orchestration. Treat these concepts distinctly:
12
13 -- A delegated task/subagent is child work owned by the current thread. Use \`orchestrator_capabilities\` to discover the current provider/model IDs from the same live catalog as the composer, including configured custom models. Do not treat a native tool's model list as the full list of available subagent models. Prefer native subagent tools for same-provider work only when they support the chosen model and no model options are requested or inherited. Use \`delegate_task\` with that provider instance and model when native tools cannot, including for same-provider work. Also use \`delegate_task\` for cross-provider or explicitly T3-owned child tasks. For a child task that needs a separate checkout, use \`delegate_task\` with \`isolation:"worktree"\` across any provider or model. It starts from the parent local commit and runs project setup; uncommitted edits are not copied. Retain each returned \`taskId\`, and use \`task_status\` or \`task_cancel\` to manage it. The returned \`childThreadId\` is backing storage for the subagent, not the target for starting another delegated review round.
13 +- A delegated task/subagent is child work owned by the current thread. Use \`orchestrator_capabilities\` to discover the current provider/model IDs from the same live catalog as the composer, including configured custom models. It lists a short set of models per provider; pass \`search\` to find others. Do not treat a native tool's model list as the full list of available subagent models. Prefer native subagent tools for same-provider work only when they support the chosen model and no model options are requested or inherited. Use \`delegate_task\` with that provider instance and model when native tools cannot, including for same-provider work. Also use \`delegate_task\` for cross-provider or explicitly T3-owned child tasks. For a child task that needs a separate checkout, use \`delegate_task\` with \`isolation:"worktree"\` across any provider or model. It starts from the parent local commit and runs project setup; uncommitted edits are not copied. Retain each returned \`taskId\`, and use \`task_status\` or \`task_cancel\` to manage it. The returned \`childThreadId\` is backing storage for the subagent, not the target for starting another delegated review round.
14 - \`t3_thread_launch\` and \`create_threads\` create ordinary top-level T3 conversations. Use them only when the user explicitly asks for separate/new/top-level threads or conversations. Never use them merely because the user said "subagent" or requested parallel delegated work.
15 - For every T3 delegated review round, call \`delegate_task\` again. Include the original brief, prior findings, responses, and unresolved objections in each new task prompt. Track each round by its own \`taskId\`. Use a distinct \`clientRequestId\` per round, stable across retries of that round. Do not use \`t3_thread_send\` on \`childThreadId\` to continue a delegated review.`,
16 `- \`schedule_task\` creates persistent recurring work in the app scheduler. Pass \`schedule\` as a structured object, never as JSON text: \`{"type":"interval","everyMs":3600000}\` for an interval, or \`{"type":"fixed_time","timeOfDay":"09:00","weekdays":[1,2,3,4,5]}\` for a wall-clock schedule, or \`{"type":"webhook"}\` to run on each request to the returned \`webhookUrl\` (the run sees the request only through \`{{body.path}}\`-style placeholders in the prompt). By default runs return to the current thread, which suits orchestrating: each trigger arrives here and you delegate or dedupe; set \`bindToCurrentThread=false\` only when the user wants a fresh thread for every run. After scheduling a timer, report the returned cadence and next run time; for a webhook, report its \`webhookUrl\`, or say T3 Connect remote access is needed if it is missing.
packages/provider-opencode/src/server/openCode2Catalog.ts
+3
@@ -44,6 +44,9 @@ export const loadOpenCode2Catalog = (
44 name: model.name,
45 ...(providerName ? { providerName } : {}),
46 variants: model.variants.map((variant) => ({ id: variant.id })),
47 + family: model.family,
48 + released: model.time.released,
49 + deprecated: model.status === "deprecated",
50 };
51 });
52 }),
packages/provider-opencode/src/server/status.test.ts
+66
@@ -665,6 +665,72 @@ it.layer(layerTest)("checkOpenCodeProviderStatus", (it) => {
665 }),
666 );
667
668 + it.effect("marks older releases of a family and deprecated models as legacy", () =>
669 + Effect.gen(function* () {
670 + const releases = [
671 + ["opencode", "opus-4-5", "claude-opus", "2025-11-24", "active"],
672 + ["opencode", "opus-5-5", "claude-opus", "2026-09-22", "active"],
673 + ["opencode", "opus-preview", "claude-opus", "2026-10-01", "deprecated"],
674 + ["opencode", "flash", "flash", "2026-09-10", "active"],
675 + ["opencode", "flash-free", "flash", "2026-09-10", "active"],
676 + ["opencode", "big-pickle", undefined, "2025-10-17", "active"],
677 + ["openrouter", "opus-4-5", "claude-opus", "2025-11-24", "active"],
678 + ] as const;
679 + const legacySlugs = (
680 + models: ReadonlyArray<{ readonly slug: string; readonly isLegacy?: boolean | undefined }>,
681 + ) =>
682 + models
683 + .filter((model) => model.isLegacy)
684 + .map((model) => model.slug)
685 + .toSorted();
686 + const expected = ["opencode/opus-4-5", "opencode/opus-preview"];
687 +
688 + runtimeMock.state.inventory = {
689 + providerList: {
690 + connected: ["opencode", "openrouter"],
691 + all: ["opencode", "openrouter"].map((providerID) => ({
692 + id: providerID,
693 + name: providerID,
694 + models: Object.fromEntries(
695 + releases
696 + .filter(([provider]) => provider === providerID)
697 + .map(([, id, family, releaseDate, status]) => [
698 + id,
699 + { id, name: id, family, release_date: releaseDate, status, variants: {} },
700 + ]),
701 + ),
702 + })),
703 + default: {},
704 + },
705 + agents: [],
706 + };
707 + NodeAssert.deepEqual(
708 + legacySlugs((yield* checkProvider(makeOpenCodeSettings())).models),
709 + expected,
710 + );
711 +
712 + runtimeMock.state.versionStdout = "opencode v2.0.18\n";
713 + const openCode2 = yield* checkProvider(
714 + makeOpenCodeSettings(),
715 + process.cwd(),
716 + undefined,
717 + undefined,
718 + Effect.succeed(
719 + releases.map(([providerID, id, family, releaseDate, status]) => ({
720 + providerID,
721 + id,
722 + name: id,
723 + variants: [],
724 + family,
725 + released: Date.parse(releaseDate),
726 + deprecated: status === "deprecated",
727 + })),
728 + ),
729 + );
730 + NodeAssert.deepEqual(legacySlugs(openCode2.models), expected);
731 + }),
732 + );
733 +
734 it.effect("reports a failed OpenCode 2 model list without the server's response", () =>
735 Effect.gen(function* () {
736 runtimeMock.state.versionStdout = "opencode v2.0.18\n";
packages/provider-opencode/src/server/status.ts
+68 -22
@@ -245,11 +245,46 @@ function openCodeCapabilitiesForModel(input: {
245 });
246 }
247
248 +interface OpenCodeRelease {
249 + readonly providerID: string;
250 + readonly family?: string | undefined;
251 + readonly released?: number | undefined;
252 + readonly deprecated?: boolean | undefined;
253 +}
254 +
255 +/**
256 + * OpenCode catalogs keep every release of a family, such as Claude Opus 4.5
257 + * through 5.5. Only the newest active release of each family within a
258 + * sub-provider stays current; older releases and deprecated models are legacy.
259 + */
260 +function markOpenCodeLegacy(
261 + entries: ReadonlyArray<{
262 + readonly model: ServerProviderModel;
263 + readonly release: OpenCodeRelease;
264 + }>,
265 +): Array<ServerProviderModel> {
266 + const familyKey = ({ providerID, family }: OpenCodeRelease) =>
267 + family ? `${providerID}/${family}` : undefined;
268 + const newest = new Map<string, number>();
269 + for (const { release } of entries) {
270 + const key = familyKey(release);
271 + if (key === undefined || release.released === undefined || release.deprecated) continue;
272 + newest.set(key, Math.max(newest.get(key) ?? release.released, release.released));
273 + }
274 + return entries.map(({ model, release }) => {
275 + const key = familyKey(release);
276 + const latest = key === undefined ? undefined : newest.get(key);
277 + const superseded =
278 + latest !== undefined && release.released !== undefined && release.released < latest;
279 + return release.deprecated || superseded ? { ...model, isLegacy: true } : model;
280 + });
281 +}
282 +
283 function flattenOpenCodeModels(
284 input: OpenCodeRuntime.OpenCodeInventory,
285 ): ReadonlyArray<ServerProviderModel> {
286 const connected = new Set(input.providerList.connected);
252 - const models: Array<ServerProviderModel> = [];
287 + const entries: Array<{ model: ServerProviderModel; release: OpenCodeRelease }> = [];
288
289 for (const provider of input.providerList.all) {
290 if (!connected.has(provider.id)) {
@@ -263,21 +298,30 @@ function flattenOpenCodeModels(
298 }
299
300 const subProvider = nonEmptyTrimmed(provider.name);
266 - models.push({
267 - slug: `${provider.id}/${model.id}`,
268 - name,
269 - ...(subProvider ? { subProvider } : {}),
270 - isCustom: false,
271 - capabilities: openCodeCapabilitiesForModel({
301 + const released = Date.parse(model.release_date);
302 + entries.push({
303 + model: {
304 + slug: `${provider.id}/${model.id}`,
305 + name,
306 + ...(subProvider ? { subProvider } : {}),
307 + isCustom: false,
308 + capabilities: openCodeCapabilitiesForModel({
309 + providerID: provider.id,
310 + model,
311 + agents: input.agents,
312 + }),
313 + },
314 + release: {
315 providerID: provider.id,
273 - model,
274 - agents: input.agents,
275 - }),
316 + family: model.family,
317 + released: Number.isNaN(released) ? undefined : released,
318 + deprecated: model.status === "deprecated",
319 + },
320 });
321 }
322 }
323
280 - return models.toSorted((left, right) => left.name.localeCompare(right.name));
324 + return markOpenCodeLegacy(entries).toSorted((left, right) => left.name.localeCompare(right.name));
325 }
326
327 function trimOptional(value: string | null | undefined): string | undefined {
@@ -372,8 +416,7 @@ export const makePendingOpenCodeProvider = Effect.fn(
416 });
417 });
418
375 -export interface OpenCode2Model {
376 - readonly providerID: string;
419 +export interface OpenCode2Model extends OpenCodeRelease {
420 readonly id: string;
421 readonly name: string;
422 readonly providerName?: string;
@@ -564,18 +607,21 @@ const checkOpenCode2 = Effect.fn("checkOpenCode2")(function* (
607 });
608 }
609 const models = providerModelsFromSettings(
567 - result.value
568 - .map((model) => {
610 + markOpenCodeLegacy(
611 + result.value.map((model) => {
612 const subProvider = subProviderLabelFor(model);
613 return {
571 - slug: `${model.providerID}/${model.id}`,
572 - name: model.name,
573 - ...(subProvider ? { subProvider } : {}),
574 - isCustom: false,
575 - capabilities: openCode2ModelCapabilities(model),
614 + model: {
615 + slug: `${model.providerID}/${model.id}`,
616 + name: model.name,
617 + ...(subProvider ? { subProvider } : {}),
618 + isCustom: false,
619 + capabilities: openCode2ModelCapabilities(model),
620 + },
621 + release: model,
622 };
577 - })
578 - .toSorted((left, right) => left.name.localeCompare(right.name)),
623 + }),
624 + ).toSorted((left, right) => left.name.localeCompare(right.name)),
625 settings.customModels,
626 DEFAULT_OPENCODE_MODEL_CAPABILITIES,
627 );