Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

ClaudeModelCatalog.test.ts

613 lines22.3 KB

1import { assert, describe, it } from "@effect/vitest";
2import { type ModelSelection, ProviderDriverKind, ProviderInstanceId } from "@t3tools/contracts";
3​
4import { resolveProviderCatalog, type ModelManifestData } from "./ModelManifest.ts";
5import {
6 BUNDLED_CLAUDE_MODEL_CATALOG,
7 capClaudeCatalogEffort,
8 type ClaudeModelCatalog,
9 claudeReportedModels,
10 formatClaudeVersionUpgradeMessage,
11 getClaudeCatalogModelCapabilities,
12 normalizeClaudeCatalogEffort,
13 resolveClaudeCatalogApiModelId,
14 resolveClaudeCatalogContextWindowTokens,
15 resolveClaudeCatalogEffort,
16 resolveClaudeModelCatalog,
17 resolveClaudeModelsForVersion,
18 resolveClaudeModelSlug,
19 resolveClaudeUpdateRequiredModels,
20 scopeClaudeModelCatalog,
21 scopeClaudeUpgradeMessageToChannel,
22 withClaudeCodeModelRoutes,
23} from "./ClaudeModelCatalog.ts";
24​
25const manifest = (): ModelManifestData => ({
26 version: 1,
27 currentModels: {},
28 providers: {
29 claudeAgent: {
30 profiles: {
31 synthetic: {
32 capabilities: {
33 optionDescriptors: [
34 {
35 id: "effort",
36 label: "Reasoning",
37 type: "select",
38 options: [{ id: "extreme", label: "Extreme", isDefault: true }],
39 },
40 {
41 id: "contextWindow",
42 label: "Context Window",
43 type: "select",
44 options: [
45 { id: "large", label: "Large", isDefault: true },
46 { id: "small", label: "Small" },
47 ],
48 },
49 ],
50 },
51 adapter: {
52 claudeCode: {
53 effortMap: { extreme: "high" },
54 modelSuffixes: { contextWindow: { large: "[large]" } },
55 },
56 },
57 },
58 },
59 models: [
60 {
61 slug: "claude-synthetic-next",
62 name: "Claude Synthetic Next",
63 aliases: ["synthetic"],
64 status: "current",
65 profile: "synthetic",
66 adapter: { claudeCode: { minVersion: "3.2.0" } },
67 },
68 ],
69 },
70 },
71});
72​
73const CLAUDE = ProviderDriverKind.make("claudeAgent");
74​
75const catalogFromManifest = (data: ModelManifestData) =>
76 resolveClaudeModelCatalog(resolveProviderCatalog(data, CLAUDE) ?? undefined);
77​
78describe("Claude model catalog", () => {
79 it("resolves capacity from selected options and fixed catalog windows without guessing custom models", () => {
80 const source = manifest();
81 const profile = source.providers!.claudeAgent!.profiles.synthetic!;
82 const catalog = catalogFromManifest({
83 ...source,
84 providers: {
85 claudeAgent: {
86 ...source.providers!.claudeAgent!,
87 profiles: {
88 fixed: {
89 capabilities: { optionDescriptors: [] },
90 adapter: { claudeCode: { fixedContextWindowTokens: 64_000 } },
91 },
92 synthetic: {
93 ...profile,
94 adapter: { claudeCode: { contextWindowTokens: { large: 1_000_000, small: 32_000 } } },
95 },
96 },
97 models: [
98 ...source.providers!.claudeAgent!.models,
99 {
100 slug: "fixed",
101 name: "Fixed",
102 status: "current",
103 profile: "fixed",
104 },
105 ],
106 },
107 },
108 });
109 const selection = { instanceId: ProviderInstanceId.make("claudeAgent"), model: "synthetic" };
110 assert.equal(resolveClaudeCatalogContextWindowTokens(catalog, selection), 1_000_000);
111 assert.equal(
112 resolveClaudeCatalogContextWindowTokens(catalog, {
113 ...selection,
114 options: [{ id: "contextWindow", value: "small" }],
115 }),
116 32_000,
117 );
118 assert.equal(
119 resolveClaudeCatalogContextWindowTokens(catalog, { ...selection, model: "fixed" }),
120 64_000,
121 );
122 assert.isUndefined(
123 resolveClaudeCatalogContextWindowTokens(catalog, { ...selection, model: "custom" }),
124 );
125 });
126​
127 it("filters models at runtime-version boundaries and derives the upgrade message", () => {
128 const catalog = catalogFromManifest(manifest());
129 assert.deepStrictEqual(resolveClaudeModelsForVersion(catalog, "3.1.9"), []);
130 assert.deepStrictEqual(
131 resolveClaudeModelsForVersion(catalog, "3.2.0").map((model) => model.slug),
132 ["claude-synthetic-next"],
133 );
134 assert.deepStrictEqual(resolveClaudeUpdateRequiredModels(catalog, "3.1.9"), [
135 { slug: "claude-synthetic-next", name: "Claude Synthetic Next", minVersion: "3.2.0" },
136 ]);
137 assert.deepStrictEqual(resolveClaudeUpdateRequiredModels(catalog, "3.2.0"), []);
138 assert.strictEqual(
139 formatClaudeVersionUpgradeMessage(catalog, "3.1.9"),
140 "Claude Code v3.1.9 is too old for Claude Synthetic Next. Upgrade to v3.2.0 or newer to access it.",
141 );
142 // A Homebrew cask that still ships 3.1.9 cannot deliver the upgrade the check asked for.
143 const probed = {
144 version: "3.1.9",
145 message: formatClaudeVersionUpgradeMessage(catalog, "3.1.9"),
146 versionAdvisory: { latestVersion: "3.1.9", updateCommand: "brew upgrade --cask claude-code" },
147 };
148 assert.strictEqual(
149 scopeClaudeUpgradeMessageToChannel(catalog, probed).message,
150 "Claude Code v3.1.9 is too old for Claude Synthetic Next, which needs v3.2.0 or newer, but the claude-code Homebrew cask only has v3.1.9. Switch to the claude-code@latest cask: brew uninstall --cask claude-code && brew install --cask claude-code@latest",
151 );
152 assert.strictEqual(
153 scopeClaudeUpgradeMessageToChannel(catalog, {
154 ...probed,
155 versionAdvisory: { latestVersion: "3.1.9", updateCommand: null },
156 }).message,
157 "Claude Code v3.1.9 is too old for Claude Synthetic Next, which needs v3.2.0 or newer, but the newest version this install can update to is v3.1.9. Install Claude Code another way or wait for a newer release.",
158 );
159 assert.strictEqual(
160 scopeClaudeUpgradeMessageToChannel(catalog, {
161 ...probed,
162 versionAdvisory: { ...probed.versionAdvisory, latestVersion: "3.2.0" },
163 }).message,
164 probed.message,
165 );
166 // Claude Code before 2.1.321 does not know claude-fable-5-2 and runs it with a 200K window.
167 assert.notInclude(
168 resolveClaudeModelsForVersion(BUNDLED_CLAUDE_MODEL_CATALOG, "2.1.320").map(
169 (model) => model.slug,
170 ),
171 "claude-fable-5-2",
172 );
173 });
174​
175 it("resolves aliases and declarative adapter mappings", () => {
176 const base = manifest();
177 const input: ModelManifestData = {
178 ...base,
179 providers: {
180 ...base.providers,
181 claudeAgent: {
182 ...base.providers!.claudeAgent!,
183 models: [
184 {
185 slug: "claude-synthetic-collision",
186 name: "Claude Synthetic Collision",
187 aliases: ["claude-synthetic-next"],
188 status: "current",
189 },
190 ...base.providers!.claudeAgent!.models,
191 ],
192 },
193 },
194 };
195 const catalog = catalogFromManifest(input);
196 assert.strictEqual(resolveClaudeModelSlug(catalog, "synthetic"), "claude-synthetic-next");
197 assert.strictEqual(
198 resolveClaudeModelSlug(catalog, "claude-synthetic-next"),
199 "claude-synthetic-next",
200 );
201 assert.strictEqual(normalizeClaudeCatalogEffort(catalog, "extreme", "synthetic"), "high");
202 assert.strictEqual(
203 resolveClaudeCatalogApiModelId(catalog, {
204 instanceId: ProviderInstanceId.make("claudeAgent"),
205 model: "synthetic",
206 }),
207 "claude-synthetic-next[large]",
208 );
209 });
210​
211 it("counts a configured gateway alias as reported even when it resolves to a catalog model", () => {
212 const catalog = catalogFromManifest(manifest());
213 const reported = [
214 {
215 value: "gateway/current[1m]",
216 resolvedModel: "claude-synthetic-next",
217 displayName: "Current",
218 description: "",
219 },
220 ];
221​
222 assert.deepStrictEqual(claudeReportedModels(catalog, ["GATEWAY/current"], reported), {
223 models: [],
224 hasNonCatalogModels: true,
225 });
226 assert.deepStrictEqual(claudeReportedModels(catalog, [], reported), {
227 models: [],
228 hasNonCatalogModels: false,
229 });
230 });
231​
232 it.each([
233 ["synthetic", "gateway/current", ["synthetic"], true],
234 ["synthetic", "gateway/current", ["gateway/current"], true],
235 ["synthetic", "gateway/current", [], false],
236 ["synthetic", "", ["synthetic"], false],
237 ["synthetic", "SYNTHETIC[1m]", ["synthetic"], false],
238 ["synthetic", "claude-synthetic-next", ["synthetic"], false],
239 ["synthetic", "global.anthropic.claude-synthetic-next-v1:0[1m]", ["synthetic"], false],
240 ["sonnet", "gateway/current", ["sonnet"], false],
241 ["sonnet", "gateway/current", ["gateway/current"], false],
242 ["sonnet", "global.anthropic.claude-sonnet-5-5[1m]", ["sonnet"], false],
243 ])(
244 "checks gateway inventory for %s resolving to %s with custom models %j",
245 (value, resolvedModel, customModels, hasNonCatalogModels) => {
246 const catalog =
247 value === "sonnet" ? BUNDLED_CLAUDE_MODEL_CATALOG : catalogFromManifest(manifest());
248 const reported = [{ value, resolvedModel, displayName: "", description: "" }];
249​
250 assert.deepStrictEqual(claudeReportedModels(catalog, customModels, reported), {
251 models: [],
252 hasNonCatalogModels,
253 });
254 },
255 );
256​
257 it("appends custom models with their own descriptors and keeps bare slugs opaque", () => {
258 const catalog = scopeClaudeModelCatalog(catalogFromManifest(manifest()), [
259 "synthetic",
260 {
261 slug: "claude-custom-tuned",
262 name: "Tuned",
263 capabilities: {
264 optionDescriptors: [
265 {
266 id: "effort",
267 label: "Reasoning",
268 type: "select",
269 options: [
270 { id: "gentle", label: "Gentle", isDefault: true },
271 { id: "brutal", label: "Brutal" },
272 { id: "ultracode", label: "Ultracode" },
273 ],
274 },
275 ],
276 },
277 },
278 ]);
279​
280 assert.strictEqual(resolveClaudeModelSlug(catalog, "synthetic"), "synthetic");
281 assert.isUndefined(resolveClaudeCatalogEffort(catalog, "synthetic", "extreme"));
282 assert.strictEqual(resolveClaudeCatalogEffort(catalog, "synthetic", "max"), "max");
283 assert.strictEqual(normalizeClaudeCatalogEffort(catalog, "max", "synthetic"), "max");
284​
285 assert.strictEqual(
286 resolveClaudeCatalogEffort(catalog, "claude-custom-tuned", "brutal"),
287 "brutal",
288 );
289 assert.strictEqual(
290 resolveClaudeCatalogEffort(catalog, "claude-custom-tuned", "bogus"),
291 "gentle",
292 );
293 assert.deepStrictEqual(
294 getClaudeCatalogModelCapabilities(catalog, "claude-custom-tuned").optionDescriptors?.map(
295 ({ id, type }) => `${id}:${type}`,
296 ),
297 ["effort:select", "ultracode:boolean"],
298 );
299 assert.strictEqual(
300 normalizeClaudeCatalogEffort(catalog, "brutal", "claude-custom-tuned"),
301 "brutal",
302 );
303 assert.strictEqual(
304 resolveClaudeCatalogApiModelId(catalog, {
305 instanceId: ProviderInstanceId.make("claudeAgent"),
306 model: "claude-custom-tuned",
307 options: [{ id: "effort", value: "brutal" }],
308 }),
309 "claude-custom-tuned",
310 );
311 assert.deepStrictEqual(
312 resolveClaudeModelsForVersion(catalog, "3.2.0").map((model) => model.slug),
313 ["claude-synthetic-next", "claude-custom-tuned"],
314 );
315 });
316​
317 // Rows Claude Code 2.1.310 reports from initialization for each configuration.
318 it("sends the model id Claude Code reports when it serves a catalog model under another id", () => {
319 const apiModel = (
320 catalog: ClaudeModelCatalog,
321 model: string,
322 options?: ModelSelection["options"],
323 ) =>
324 resolveClaudeCatalogApiModelId(catalog, {
325 instanceId: ProviderInstanceId.make("claudeAgent"),
326 model,
327 ...(options ? { options } : {}),
328 });
329​
330 // Bedrock with ANTHROPIC_DEFAULT_*_MODEL and an availableModels allowlist of their ids.
331 const configuredBedrock = withClaudeCodeModelRoutes(BUNDLED_CLAUDE_MODEL_CATALOG, [
332 { value: "default", resolvedModel: "global.anthropic.claude-opus-5-5" },
333 { value: "sonnet", resolvedModel: "global.anthropic.claude-sonnet-5-5[1m]" },
334 { value: "opus", resolvedModel: "global.anthropic.claude-opus-5-5" },
335 { value: "haiku", resolvedModel: "global.anthropic.claude-haiku-5-5" },
336 ]);
337 assert.strictEqual(apiModel(configuredBedrock, "claude-haiku-5-5"), "haiku");
338 assert.strictEqual(apiModel(configuredBedrock, "haiku-5.5"), "haiku");
339 assert.strictEqual(apiModel(configuredBedrock, "claude-sonnet-5-5"), "sonnet");
340 assert.strictEqual(apiModel(configuredBedrock, "claude-opus-5-5"), "opus");
341 assert.strictEqual(apiModel(configuredBedrock, "claude-opus-5"), "claude-opus-5");
342​
343 // Bedrock with no model settings: Claude Code's `haiku` is Haiku 4.5 there.
344 const defaultBedrock = withClaudeCodeModelRoutes(BUNDLED_CLAUDE_MODEL_CATALOG, [
345 {
346 value: "us.anthropic.claude-opus-4-6-v1",
347 resolvedModel: "us.anthropic.claude-opus-4-6-v1",
348 },
349 {
350 value: "us.anthropic.claude-opus-4-6-v1[1m]",
351 resolvedModel: "us.anthropic.claude-opus-4-6-v1[1m]",
352 },
353 { value: "haiku", resolvedModel: "us.anthropic.claude-haiku-4-5-20251001-v1:0" },
354 ]);
355 assert.strictEqual(
356 apiModel(defaultBedrock, "claude-opus-4-6", [{ id: "contextWindow", value: "1m" }]),
357 "us.anthropic.claude-opus-4-6-v1[1m]",
358 );
359 assert.strictEqual(
360 apiModel(defaultBedrock, "claude-opus-4-6", [{ id: "contextWindow", value: "200k" }]),
361 "us.anthropic.claude-opus-4-6-v1",
362 );
363 assert.strictEqual(apiModel(defaultBedrock, "claude-haiku-4-5"), "haiku");
364 assert.strictEqual(apiModel(defaultBedrock, "claude-haiku-5-5"), "claude-haiku-5-5");
365​
366 // First-party ids already are what Claude Code runs, even when an alias points elsewhere.
367 const firstParty = withClaudeCodeModelRoutes(BUNDLED_CLAUDE_MODEL_CATALOG, [
368 { value: "default", resolvedModel: "claude-opus-5-5" },
369 { value: "opus", resolvedModel: "claude-opus-5-5" },
370 { value: "claude-fable-5-1[1m]", resolvedModel: "claude-fable-5-1[1m]" },
371 { value: "haiku", resolvedModel: "claude-haiku-4-5-20251001" },
372 ]);
373 assert.strictEqual(firstParty, BUNDLED_CLAUDE_MODEL_CATALOG);
374 });
375​
376 it("marks effort options that would run above the cap without changing ids or defaults", () => {
377 const effortModel = (slug: string) => ({
378 slug,
379 name: slug,
380 isCustom: false,
381 capabilities: {
382 optionDescriptors: [
383 {
384 id: "effort",
385 label: "Reasoning",
386 type: "select" as const,
387 options: [
388 { id: "medium", label: "Medium" },
389 { id: "high", label: "High", isDefault: true },
390 { id: "xhigh", label: "Extra High" },
391 { id: "max", label: "Max" },
392 { id: "ultracode", label: "Ultracode" },
393 { id: "ultrathink", label: "Ultrathink" },
394 ],
395 },
396 ],
397 },
398 });
399 const models = [effortModel("claude-plain"), effortModel("claude-remapped")];
400 const catalog: ClaudeModelCatalog = {
401 models: [
402 {
403 model: models[0]!,
404 runtime: { effortMap: { ultracode: "xhigh", ultrathink: null } },
405 compatibility: {},
406 },
407 {
408 model: models[1]!,
409 runtime: { effortMap: { max: "high", xhigh: "max", ultrathink: null } },
410 compatibility: {},
411 },
412 ],
413 };
414 const options = (cap: "high" | "xhigh") =>
415 capClaudeCatalogEffort(catalog, models, [{ maxEffortLevel: cap }]).map((model) => {
416 const effort = model.capabilities?.optionDescriptors?.[0];
417 return effort?.type === "select" ? effort.options : undefined;
418 });
419​
420 assert.deepStrictEqual(options("high"), [
421 [
422 { id: "medium", label: "Medium" },
423 { id: "high", label: "High", isDefault: true },
424 { id: "xhigh", label: "Extra High (capped to High)" },
425 { id: "max", label: "Max (capped to High)" },
426 { id: "ultracode", label: "Ultracode (capped to High)" },
427 { id: "ultrathink", label: "Ultrathink" },
428 ],
429 [
430 { id: "medium", label: "Medium" },
431 { id: "high", label: "High", isDefault: true },
432 { id: "xhigh", label: "Extra High (capped to High)" },
433 { id: "max", label: "Max" },
434 { id: "ultracode", label: "Ultracode" },
435 { id: "ultrathink", label: "Ultrathink" },
436 ],
437 ]);
438 // An effortMap that sends Extra High as max stays unmarked under an xhigh cap: the CLI runs
439 // it at xhigh, which is what the label says.
440 assert.deepStrictEqual(
441 options("xhigh").map((model) => model?.map((option) => option.label)),
442 [
443 ["Medium", "High", "Extra High", "Max (capped to Extra High)", "Ultracode", "Ultrathink"],
444 ["Medium", "High", "Extra High", "Max", "Ultracode", "Ultrathink"],
445 ],
446 );
447​
448 // A per-model cap applies without a top-level one and leaves other models uncapped.
449 assert.deepStrictEqual(
450 capClaudeCatalogEffort(catalog, models, [
451 { modelMaxEffortLevels: new Map([["claude-plain", "high"]]) },
452 ]).map((model) => {
453 const effort = model.capabilities?.optionDescriptors?.[0];
454 return effort?.type === "select" ? effort.options.map((option) => option.label) : [];
455 }),
456 [
457 [
458 "Medium",
459 "High",
460 "Extra High (capped to High)",
461 "Max (capped to High)",
462 "Ultracode (capped to High)",
463 "Ultrathink",
464 ],
465 ["Medium", "High", "Extra High", "Max", "Ultracode", "Ultrathink"],
466 ],
467 );
468​
469 // Without an Extra High option (Opus 4.6), the CLI clamps an xhigh cap down to High.
470 const noXhigh = {
471 slug: "claude-no-xhigh",
472 name: "claude-no-xhigh",
473 isCustom: false,
474 capabilities: {
475 optionDescriptors: [
476 {
477 id: "effort",
478 label: "Reasoning",
479 type: "select" as const,
480 options: [
481 { id: "low", label: "Low" },
482 { id: "medium", label: "Medium" },
483 { id: "high", label: "High", isDefault: true },
484 { id: "max", label: "Max" },
485 ],
486 },
487 ],
488 },
489 };
490 const [capped] = capClaudeCatalogEffort(
491 { models: [] },
492 [noXhigh],
493 [{ maxEffortLevel: "xhigh" }],
494 );
495 const cappedEffort = capped?.capabilities?.optionDescriptors?.[0];
496 assert.deepStrictEqual(
497 cappedEffort?.type === "select" ? cappedEffort.options.map((option) => option.label) : [],
498 ["Low", "Medium", "High", "Max (capped to High)"],
499 );
500 });
501​
502 it("leaves custom model effort labels alone under a cap", () => {
503 const custom = {
504 slug: "claude-custom-copy",
505 name: "Copy",
506 isCustom: true,
507 capabilities: {
508 optionDescriptors: [
509 {
510 id: "effort",
511 label: "Reasoning",
512 type: "select" as const,
513 options: [
514 { id: "high", label: "High", isDefault: true },
515 { id: "max", label: "Max (capped to High)" },
516 ],
517 },
518 ],
519 },
520 };
521​
522 assert.deepStrictEqual(
523 capClaudeCatalogEffort({ models: [] }, [custom], [{ maxEffortLevel: "high" }]),
524 [custom],
525 );
526 });
527​
528 it("resolves maxEffortLevel per settings source and per model key like Claude Code", () => {
529 const opus = {
530 slug: "claude-opus-5-5",
531 name: "Opus 5.5",
532 isCustom: false,
533 aliases: ["opus", "opus-5.5", "claude-opus-5.5"],
534 capabilities: {
535 optionDescriptors: [
536 {
537 id: "effort",
538 label: "Reasoning",
539 type: "select" as const,
540 options: [
541 { id: "low", label: "Low" },
542 { id: "medium", label: "Medium" },
543 { id: "high", label: "High", isDefault: true },
544 { id: "max", label: "Max" },
545 ],
546 },
547 ],
548 },
549 };
550 const catalog: ClaudeModelCatalog = {
551 models: [
552 { model: opus, runtime: {}, compatibility: {} },
553 {
554 model: {
555 slug: "claude-opus-5",
556 name: "Opus 5",
557 isCustom: false,
558 capabilities: { optionDescriptors: [] },
559 },
560 runtime: {},
561 compatibility: {},
562 },
563 ],
564 };
565 const maxLabel = (sources: Parameters<typeof capClaudeCatalogEffort>[2]) => {
566 const effort = capClaudeCatalogEffort(catalog, [opus], sources)[0]?.capabilities
567 ?.optionDescriptors?.[0];
568 return effort?.type === "select" ? effort.options.at(-1)?.label : undefined;
569 };
570 const perModel = (entries: Record<string, "low" | "medium" | "high" | "max">) => ({
571 modelMaxEffortLevels: new Map(Object.entries(entries)),
572 });
573​
574 // Claude Code matches family aliases and [1m] spellings case-insensitively.
575 assert.strictEqual(maxLabel([perModel({ Opus: "medium" })]), "Max (capped to Medium)");
576 assert.strictEqual(
577 maxLabel([perModel({ "claude-opus-5-5[1M]": "medium" })]),
578 "Max (capped to Medium)",
579 );
580 assert.strictEqual(maxLabel([perModel({ " OPUS[1m] ": "medium" })]), "Max (capped to Medium)");
581 // Other keys name the most specific model id they contain, so dated and provider-prefixed ids
582 // match while the catalog's dotted aliases and a less specific model id do not.
583 for (const key of [
584 "claude-opus-5-5-20260101",
585 "CLAUDE-OPUS-5-5-20260101[1m]",
586 "us.anthropic.claude-opus-5-5-v1:0",
587 "claude-opus-5-5-latest",
588 ]) {
589 assert.strictEqual(maxLabel([perModel({ [key]: "medium" })]), "Max (capped to Medium)", key);
590 }
591 for (const key of ["claude-opus-5.5", "opus-5.5", "opus-5-5", "opus [1m]", "claude-opus-5"]) {
592 assert.strictEqual(maxLabel([perModel({ [key]: "medium" })]), "Max", key);
593 }
594 // Keys naming the same model keep the lowest cap, and a `max` key does not exempt it.
595 assert.strictEqual(
596 maxLabel([perModel({ opus: "max", "claude-opus-5-5": "low" })]),
597 "Max (capped to Low)",
598 );
599 // A per-model `max` only exempts the model from its own source's top-level cap.
600 assert.strictEqual(
601 maxLabel([{ maxEffortLevel: "medium", ...perModel({ opus: "max" }) }]),
602 "Max",
603 );
604 assert.strictEqual(
605 maxLabel([perModel({ opus: "max" }), { maxEffortLevel: "high" }]),
606 "Max (capped to High)",
607 );
608 assert.strictEqual(
609 maxLabel([{ maxEffortLevel: "medium" }, perModel({ opus: "high" })]),
610 "Max (capped to Medium)",
611 );
612 });
613});