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

ModelManifest.test.ts

681 lines22.5 KB

1import { assert, describe, it } from "@effect/vitest";
2import * as NodeServices from "@effect/platform-node/NodeServices";
3import { ProviderDriverKind, type ServerProviderModel } from "@t3tools/contracts";
4import * as Effect from "effect/Effect";
5import * as FileSystem from "effect/FileSystem";
6import * as Layer from "effect/Layer";
7import * as Path from "effect/Path";
8import * as TestClock from "effect/testing/TestClock";
9import { HttpClient, HttpClientResponse } from "effect/unstable/http";
10​
11import * as ServerConfig from "../config.ts";
12import * as ServerSettings from "../serverSettings.ts";
13import * as ModelManifest from "./ModelManifest.ts";
14import { resolveProviderCompatibility } from "./providerCompatibility.ts";
15​
16/**
17 * Test policy: this file covers manifest machinery, not manifest contents.
18 * Do not add assertions for real model slugs, names, status, aliases, or
19 * profiles when editing model-manifest.json. Add tests only when fetch/cache
20 * behavior or the provider-neutral resolver semantics change, and use
21 * synthetic models for resolver coverage.
22 */
23​
24const CODEX = ProviderDriverKind.make("codex");
25const model = (overrides: Partial<ServerProviderModel>): ServerProviderModel => ({
26 slug: "gpt-test",
27 name: "GPT Test",
28 isCustom: false,
29 capabilities: null,
30 ...overrides,
31});
32​
33describe("classifyModels", () => {
34 it("classifies qualified Codex families without changing their wire ids", () => {
35 const manifest: ModelManifest.ModelManifestData = {
36 version: 1,
37 currentModels: { codex: ["gpt-test"] },
38 };
39 const models = [
40 model({ slug: "openai.gpt-test", isLegacy: true }),
41 model({ slug: "openai.gpt-old" }),
42 ];
43 assert.deepStrictEqual(
44 ModelManifest.classifyModels(models, manifest, CODEX).map((entry) => [
45 entry.slug,
46 entry.isLegacy ?? false,
47 ]),
48 [
49 ["openai.gpt-test", false],
50 ["openai.gpt-old", true],
51 ],
52 );
53 });
54 it("flags non-current models, clears stale flags, and skips custom models", () => {
55 const manifest: ModelManifest.ModelManifestData = {
56 version: 1,
57 currentModels: { codex: ["current-a", "current-b"] },
58 };
59 const models = [
60 model({ slug: "current-a" }),
61 // Stale flag from a previous classification pass must be cleared.
62 model({ slug: "current-b", isLegacy: true }),
63 model({ slug: "old-model" }),
64 // Custom models are user-defined and never reclassified.
65 model({ slug: "my-own-model", isCustom: true }),
66 ];
67 assert.deepStrictEqual(
68 ModelManifest.classifyModels(models, manifest, CODEX).map((entry) => [
69 entry.slug,
70 entry.isLegacy ?? false,
71 ]),
72 [
73 ["current-a", false],
74 ["current-b", false],
75 ["old-model", true],
76 ["my-own-model", false],
77 ],
78 );
79 });
80});
81​
82describe("applyManifestDefault", () => {
83 it("resolves the manifest default to the qualified live model", () => {
84 const manifest: ModelManifest.ModelManifestData = {
85 version: 1,
86 currentModels: {},
87 providers: { codex: { models: [], profiles: {}, defaults: { chat: "gpt-test" } } },
88 };
89 const models = [
90 model({ slug: "openai.gpt-old", isDefault: true }),
91 model({ slug: "openai.gpt-test" }),
92 ];
93 assert.strictEqual(
94 ModelManifest.applyManifestDefault(models, manifest, CODEX).find((entry) => entry.isDefault)
95 ?.slug,
96 "openai.gpt-test",
97 );
98 });
99 it("moves the default flag and its aliases to the manifest's chat default", () => {
100 const driver = ProviderDriverKind.make("antigravity");
101 const manifest: ModelManifest.ModelManifestData = {
102 version: 1,
103 currentModels: {},
104 providers: {
105 antigravity: {
106 defaults: { chat: "gemini-new" },
107 profiles: {},
108 models: [{ slug: "gemini-new", name: "New", status: "current" }],
109 },
110 },
111 };
112 const models = [
113 model({ slug: "gemini-old", isDefault: true, aliases: ["antigravity-default"] }),
114 model({ slug: "gemini-new" }),
115 ];
116 assert.deepStrictEqual(ModelManifest.applyManifestDefault(models, manifest, driver), [
117 model({ slug: "gemini-old" }),
118 model({ slug: "gemini-new", isDefault: true, aliases: ["antigravity-default"] }),
119 ]);
120 // The account does not offer the manifest default: keep the runtime's choice.
121 assert.deepStrictEqual(
122 ModelManifest.applyManifestDefault(models.slice(0, 1), manifest, driver),
123 models.slice(0, 1),
124 );
125 });
126});
127​
128describe("resolveProviderCatalog", () => {
129 it("resolves generic model presentation through a reusable profile", () => {
130 const manifest: ModelManifest.ModelManifestData = {
131 version: 1,
132 currentModels: {},
133 providers: {
134 synthetic: {
135 defaults: { chat: "model-next" },
136 profiles: {
137 standard: {
138 capabilities: {
139 optionDescriptors: [
140 {
141 id: "mode",
142 label: "Mode",
143 type: "select",
144 options: [{ id: "fast", label: "Fast", isDefault: true }],
145 },
146 ],
147 },
148 adapter: { opaque: true },
149 },
150 },
151 models: [
152 {
153 slug: "model-next",
154 name: "Model Next",
155 aliases: ["next"],
156 status: "current",
157 badge: "new",
158 profile: "standard",
159 },
160 ],
161 },
162 },
163 };
164​
165 const catalog = ModelManifest.resolveProviderCatalog(
166 manifest,
167 ProviderDriverKind.make("synthetic"),
168 );
169 assert.deepStrictEqual(catalog?.models[0], {
170 model: {
171 slug: "model-next",
172 name: "Model Next",
173 aliases: ["next"],
174 badge: "new",
175 isCustom: false,
176 isDefault: true,
177 capabilities: manifest.providers!.synthetic!.profiles.standard!.capabilities!,
178 },
179 adapter: undefined,
180 profileAdapter: { opaque: true },
181 });
182 });
183​
184 it("rejects invalid catalog references", () => {
185 const invalidCatalog = (input: {
186 readonly models: NonNullable<ModelManifest.ModelManifestData["providers"]>[string]["models"];
187 readonly defaultChat?: string;
188 }): ModelManifest.ModelManifestData => ({
189 version: 1,
190 currentModels: {},
191 providers: {
192 synthetic: {
193 ...(input.defaultChat ? { defaults: { chat: input.defaultChat } } : {}),
194 profiles: {},
195 models: input.models,
196 },
197 },
198 });
199​
200 for (const invalid of [
201 invalidCatalog({
202 models: [
203 { slug: "duplicate", name: "First", status: "current" },
204 { slug: "duplicate", name: "Second", status: "current" },
205 ],
206 }),
207 invalidCatalog({
208 models: [
209 {
210 slug: "missing-profile",
211 name: "Missing Profile",
212 status: "current",
213 profile: "missing",
214 },
215 ],
216 }),
217 invalidCatalog({
218 models: [{ slug: "present", name: "Present", status: "current" }],
219 defaultChat: "absent",
220 }),
221 ]) {
222 assert.isNull(
223 ModelManifest.resolveProviderCatalog(invalid, ProviderDriverKind.make("synthetic")),
224 );
225 }
226 });
227});
228​
229// Remote fixtures date after the bundle so a fetch still outranks it.
230const REMOTE_UPDATED_AT = "2099-01-01T00:00:00Z";
231​
232const REMOTE_MANIFEST: ModelManifest.ModelManifestData = {
233 version: 1,
234 updatedAt: REMOTE_UPDATED_AT,
235 currentModels: {
236 codex: ["remote-model"],
237 claudeAgent: ["remote-agent-model"],
238 },
239};
240​
241const REMOTE_CLAUDE_MANIFEST: ModelManifest.ModelManifestData = {
242 version: 1,
243 updatedAt: REMOTE_UPDATED_AT,
244 currentModels: {},
245 providers: {
246 claudeAgent: {
247 profiles: {
248 synthetic: {
249 adapter: { claudeCode: { effortMap: { extreme: "high" } } },
250 },
251 },
252 models: [
253 {
254 slug: "remote-only-model",
255 name: "Remote Only Model",
256 status: "current",
257 profile: "synthetic",
258 },
259 ],
260 },
261 },
262};
263​
264const remoteClaudeManifestWithCompatibility = (
265 compatibility: unknown,
266): ModelManifest.ModelManifestData => ({
267 ...REMOTE_CLAUDE_MANIFEST,
268 providers: {
269 claudeAgent: {
270 profiles: REMOTE_CLAUDE_MANIFEST.providers!.claudeAgent!.profiles,
271 models: REMOTE_CLAUDE_MANIFEST.providers!.claudeAgent!.models.map((model) => ({
272 ...model,
273 adapter: { claudeCode: compatibility },
274 })),
275 },
276 },
277});
278​
279const INVALID_REMOTE_MANIFESTS: ReadonlyArray<ModelManifest.ModelManifestData> = [
280 {
281 ...REMOTE_CLAUDE_MANIFEST,
282 providers: {
283 claudeAgent: {
284 profiles: {
285 synthetic: {
286 adapter: { claudeCode: { effortMap: { extreme: 123 } } },
287 },
288 },
289 models: REMOTE_CLAUDE_MANIFEST.providers!.claudeAgent!.models,
290 },
291 },
292 },
293 {
294 ...REMOTE_CLAUDE_MANIFEST,
295 providers: {
296 claudeAgent: {
297 profiles: {},
298 models: REMOTE_CLAUDE_MANIFEST.providers!.claudeAgent!.models,
299 },
300 },
301 },
302 {
303 ...REMOTE_CLAUDE_MANIFEST,
304 providers: {
305 claudeAgent: {
306 profiles: REMOTE_CLAUDE_MANIFEST.providers!.claudeAgent!.profiles,
307 models: [
308 ...REMOTE_CLAUDE_MANIFEST.providers!.claudeAgent!.models,
309 {
310 slug: "remote-only-model",
311 name: "Duplicate Remote Model",
312 status: "current",
313 profile: "synthetic",
314 },
315 ],
316 },
317 },
318 },
319 {
320 ...REMOTE_CLAUDE_MANIFEST,
321 providers: {
322 claudeAgent: {
323 defaults: { chat: "absent-model" },
324 profiles: REMOTE_CLAUDE_MANIFEST.providers!.claudeAgent!.profiles,
325 models: REMOTE_CLAUDE_MANIFEST.providers!.claudeAgent!.models,
326 },
327 },
328 },
329 remoteClaudeManifestWithCompatibility({ minVersion: "2.x" }),
330 remoteClaudeManifestWithCompatibility({ maxVersionExclusive: "2.x" }),
331 remoteClaudeManifestWithCompatibility({
332 minVersion: "2.2",
333 maxVersionExclusive: "2.1",
334 }),
335];
336​
337const httpClientLayer = (handler: () => Response) =>
338 Layer.succeed(
339 HttpClient.HttpClient,
340 HttpClient.make((request) => Effect.succeed(HttpClientResponse.fromWeb(request, handler()))),
341 );
342​
343const serviceLayers = (input: {
344 readonly prefix: string;
345 readonly response: () => Response;
346 readonly settings?: Parameters<typeof ServerSettings.layerTest>[0];
347}) =>
348 ServerConfig.layerTest(process.cwd(), { prefix: input.prefix }).pipe(
349 Layer.provideMerge(NodeServices.layer),
350 Layer.provideMerge(ServerSettings.layerTest(input.settings ?? {})),
351 Layer.provideMerge(httpClientLayer(input.response)),
352 );
353​
354describe("ModelManifest service", () => {
355 it.live("explicit refresh bypasses fresh memory and disk caches", () => {
356 let fetchCount = 0;
357 const updated: ModelManifest.ModelManifestData = {
358 ...REMOTE_MANIFEST,
359 currentModels: { codex: ["gpt-reloaded"] },
360 };
361 return Effect.gen(function* () {
362 const service = yield* ModelManifest.make;
363 assert.deepStrictEqual(yield* service.refresh, REMOTE_MANIFEST);
364 assert.deepStrictEqual(yield* service.refresh, REMOTE_MANIFEST);
365 assert.strictEqual(fetchCount, 1);
366​
367 const rebooted = yield* ModelManifest.make;
368 assert.deepStrictEqual(yield* rebooted.refresh, REMOTE_MANIFEST);
369 assert.strictEqual(fetchCount, 1);
370 assert.deepStrictEqual(yield* rebooted.forceRefresh, updated);
371 assert.strictEqual(fetchCount, 2);
372 assert.deepStrictEqual(yield* rebooted.current, updated);
373 assert.deepStrictEqual(yield* (yield* ModelManifest.make).current, updated);
374 }).pipe(
375 Effect.scoped,
376 Effect.provide(
377 serviceLayers({
378 prefix: "model-manifest-force-refresh-test",
379 response: () => Response.json(fetchCount++ === 0 ? REMOTE_MANIFEST : updated),
380 }),
381 ),
382 );
383 });
384​
385 it.live("explicit refresh retries immediately after failure and preserves last-good data", () => {
386 let fetchCount = 0;
387 return Effect.gen(function* () {
388 const service = yield* ModelManifest.make;
389 assert.deepStrictEqual(yield* service.refresh, REMOTE_MANIFEST);
390 assert.deepStrictEqual(yield* service.forceRefresh, REMOTE_MANIFEST);
391 assert.deepStrictEqual(yield* service.current, REMOTE_MANIFEST);
392 assert.deepStrictEqual(yield* (yield* ModelManifest.make).current, REMOTE_MANIFEST);
393 assert.strictEqual(fetchCount, 2);
394 assert.deepStrictEqual(yield* service.forceRefresh, REMOTE_MANIFEST);
395 assert.strictEqual(fetchCount, 3);
396 }).pipe(
397 Effect.scoped,
398 Effect.provide(
399 serviceLayers({
400 prefix: "model-manifest-force-retry-test",
401 response: () =>
402 fetchCount++ === 1
403 ? new Response(null, { status: 503 })
404 : Response.json(REMOTE_MANIFEST),
405 }),
406 ),
407 );
408 });
409​
410 it.live("explicit refresh bypasses the retry delay after an initial failure", () => {
411 let fetchCount = 0;
412 return Effect.gen(function* () {
413 const service = yield* ModelManifest.make;
414 assert.deepStrictEqual(yield* service.refresh, ModelManifest.BUNDLED_MODEL_MANIFEST);
415 assert.deepStrictEqual(yield* service.refresh, ModelManifest.BUNDLED_MODEL_MANIFEST);
416 assert.strictEqual(fetchCount, 1);
417 assert.deepStrictEqual(yield* service.forceRefresh, REMOTE_MANIFEST);
418 assert.strictEqual(fetchCount, 2);
419 }).pipe(
420 Effect.scoped,
421 Effect.provide(
422 serviceLayers({
423 prefix: "model-manifest-force-initial-retry-test",
424 response: () =>
425 fetchCount++ === 0
426 ? new Response(null, { status: 503 })
427 : Response.json(REMOTE_MANIFEST),
428 }),
429 ),
430 );
431 });
432​
433 it.live("prefers a fetched manifest over the bundle and caches it to disk", () =>
434 Effect.gen(function* () {
435 const service = yield* ModelManifest.make;
436 const refreshed = yield* service.refresh;
437 assert.deepStrictEqual(refreshed, REMOTE_MANIFEST);
438​
439 // A fresh service instance sees the disk cache without another fetch:
440 // its HTTP layer is still stubbed, but `current` never fetches at all.
441 const rebooted = yield* ModelManifest.make;
442 assert.deepStrictEqual(yield* rebooted.current, REMOTE_MANIFEST);
443 }).pipe(
444 Effect.scoped,
445 Effect.provide(
446 serviceLayers({
447 prefix: "model-manifest-fetch-test",
448 response: () => Response.json(REMOTE_MANIFEST),
449 }),
450 ),
451 ),
452 );
453​
454 it.live("ignores older remote edits without replacing the current manifest or disk cache", () => {
455 let remote = { ...REMOTE_MANIFEST, updatedAt: "2000-01-01T00:00:00Z" };
456 return Effect.gen(function* () {
457 const service = yield* ModelManifest.make;
458 assert.deepStrictEqual(yield* service.refresh, ModelManifest.BUNDLED_MODEL_MANIFEST);
459 assert.deepStrictEqual(yield* service.current, ModelManifest.BUNDLED_MODEL_MANIFEST);
460​
461 remote = { ...REMOTE_MANIFEST, updatedAt: REMOTE_UPDATED_AT };
462 assert.deepStrictEqual(yield* service.forceRefresh, REMOTE_MANIFEST);
463 remote = { ...REMOTE_MANIFEST, updatedAt: ModelManifest.BUNDLED_MODEL_MANIFEST.updatedAt! };
464 assert.deepStrictEqual(yield* service.forceRefresh, REMOTE_MANIFEST);
465 const rebooted = yield* ModelManifest.make;
466 assert.deepStrictEqual(yield* rebooted.current, REMOTE_MANIFEST);
467 }).pipe(
468 Effect.scoped,
469 Effect.provide(
470 serviceLayers({
471 prefix: "model-manifest-stale-fetch-test",
472 response: () => Response.json(remote),
473 }),
474 ),
475 );
476 });
477​
478 it.live("keeps the bundled manifest when the remote payload is malformed", () =>
479 Effect.gen(function* () {
480 const service = yield* ModelManifest.make;
481 assert.deepStrictEqual(yield* service.refresh, ModelManifest.BUNDLED_MODEL_MANIFEST);
482 }).pipe(
483 Effect.scoped,
484 Effect.provide(
485 serviceLayers({
486 prefix: "model-manifest-malformed-test",
487 response: () => Response.json({ version: 999, nonsense: true }),
488 }),
489 ),
490 ),
491 );
492​
493 it.effect("preserves the last-good remote cache when later payloads are invalid", () => {
494 let responseIndex = 0;
495 const responses = [REMOTE_CLAUDE_MANIFEST, ...INVALID_REMOTE_MANIFESTS];
496​
497 return Effect.gen(function* () {
498 const service = yield* ModelManifest.make;
499 assert.deepStrictEqual(yield* service.refresh, REMOTE_CLAUDE_MANIFEST);
500​
501 for (const _invalid of INVALID_REMOTE_MANIFESTS) {
502 yield* TestClock.adjust("1 hour");
503 responseIndex += 1;
504 assert.deepStrictEqual(yield* service.refresh, REMOTE_CLAUDE_MANIFEST);
505 }
506​
507 const rebooted = yield* ModelManifest.make;
508 assert.deepStrictEqual(yield* rebooted.current, REMOTE_CLAUDE_MANIFEST);
509 }).pipe(
510 Effect.scoped,
511 Effect.provide(
512 serviceLayers({
513 prefix: "model-manifest-last-good-test",
514 response: () => Response.json(responses[responseIndex]),
515 }),
516 ),
517 );
518 });
519​
520 it.live("drops a disk cache of a manifest older than the bundled one", () =>
521 Effect.gen(function* () {
522 const fs = yield* FileSystem.FileSystem;
523 const path = yield* Path.Path;
524 const config = yield* ServerConfig.ServerConfig;
525 const cachePath = path.join(config.stateDir, "model-manifest.json");
526 // A cache of the manifest as it was before the release edited it. The
527 // fetch time is irrelevant: the remote may be unreachable now, so
528 // `current` must already prefer the bundle.
529 const { updatedAt: _undated, ...undatedManifest } = REMOTE_MANIFEST;
530 for (const stale of [
531 undatedManifest,
532 { ...REMOTE_MANIFEST, updatedAt: "2000-01-01T00:00:00Z" },
533 ]) {
534 yield* fs.writeFileString(
535 cachePath,
536 yield* ModelManifest.encodeManifestCache({ fetchedAtMs: 0, manifest: stale }),
537 );
538 const service = yield* ModelManifest.make;
539 assert.deepStrictEqual(yield* service.current, ModelManifest.BUNDLED_MODEL_MANIFEST);
540 }
541​
542 // A cache of a newer edit still outranks the bundle.
543 yield* fs.writeFileString(
544 cachePath,
545 yield* ModelManifest.encodeManifestCache({ fetchedAtMs: 0, manifest: REMOTE_MANIFEST }),
546 );
547 const later = yield* ModelManifest.make;
548 assert.deepStrictEqual(yield* later.current, REMOTE_MANIFEST);
549 }).pipe(
550 Effect.scoped,
551 Effect.provide(
552 serviceLayers({
553 prefix: "model-manifest-newer-bundle-test",
554 response: () => Response.json(REMOTE_MANIFEST),
555 }),
556 ),
557 ),
558 );
559​
560 it.live("does not fetch when provider update checks are disabled", () =>
561 Effect.gen(function* () {
562 let fetchCount = 0;
563 const service = yield* ModelManifest.make.pipe(
564 Effect.provide(
565 httpClientLayer(() => {
566 fetchCount += 1;
567 return Response.json(REMOTE_MANIFEST);
568 }),
569 ),
570 );
571 assert.deepStrictEqual(yield* service.refresh, ModelManifest.BUNDLED_MODEL_MANIFEST);
572 assert.deepStrictEqual(yield* service.forceRefresh, ModelManifest.BUNDLED_MODEL_MANIFEST);
573 assert.strictEqual(fetchCount, 0);
574 }).pipe(
575 Effect.scoped,
576 Effect.provide(
577 serviceLayers({
578 prefix: "model-manifest-optout-test",
579 response: () => Response.json(REMOTE_MANIFEST),
580 settings: { enableProviderUpdateChecks: false },
581 }),
582 ),
583 ),
584 );
585});
586​
587// TEMPORARY V2 preview stopgap; remove with `withPreviewCompatibility` (#2829).
588describe("compatibility policy by release channel", () => {
589 const OPENCODE = ProviderDriverKind.make("opencode");
590 // Main's OpenCode policy (#14198): stable and nightly have no OpenCode 2 runtime.
591 const remote: ModelManifest.ModelManifestData = {
592 ...REMOTE_MANIFEST,
593 compatibility: [
594 {
595 driver: OPENCODE,
596 t3CodeRange: ">=0.0.42",
597 recommendedRange: ">=1.14.19 <2.0.0",
598 recommendedVersion: "1.14.19",
599 ranges: [
600 { range: ">=2.0.0", status: "broken" },
601 { range: ">=1.14.19 <2.0.0", status: "supported" },
602 { range: "<1.14.19", status: "broken" },
603 ],
604 },
605 ],
606 };
607​
608 for (const [channel, t3CodeVersion, expected, openCode2Status] of [
609 [
610 "preview builds keep the bundled policy",
611 "0.0.44-preview.20260929.1",
612 { ...remote, compatibility: ModelManifest.BUNDLED_MODEL_MANIFEST.compatibility },
613 "supported",
614 ],
615 ["stable builds adopt the fetched policy", "0.0.44", remote, "broken"],
616 ["nightly builds adopt the fetched policy", "0.0.44-nightly.20260929.1", remote, "broken"],
617 ] as const) {
618 it.live(channel, () =>
619 Effect.gen(function* () {
620 const openCode2 = (manifest: ModelManifest.ModelManifestData) =>
621 resolveProviderCompatibility(manifest.compatibility, OPENCODE, "2.0.18", t3CodeVersion)
622 ?.status;
623 const refreshed = yield* (yield* ModelManifest.makeForVersion(t3CodeVersion)).refresh;
624 assert.deepStrictEqual(refreshed, expected);
625 assert.strictEqual(openCode2(refreshed), openCode2Status);
626​
627 // A restart reads the fetched manifest back from the disk cache.
628 const rebooted = yield* (yield* ModelManifest.makeForVersion(t3CodeVersion)).current;
629 assert.deepStrictEqual(rebooted, expected);
630 }).pipe(
631 Effect.scoped,
632 Effect.provide(
633 serviceLayers({
634 prefix: "model-manifest-channel-compatibility-test",
635 response: () => Response.json(remote),
636 }),
637 ),
638 ),
639 );
640 }
641});
642​
643it.effect("caches valid compatibility policies and keeps them after a malformed refresh", () => {
644 const remote: ModelManifest.ModelManifestData = {
645 ...REMOTE_MANIFEST,
646 compatibility: [
647 {
648 driver: "codex",
649 t3CodeRange: ">=0.0.42",
650 recommendedVersion: "2.0.0",
651 ranges: [{ range: "=2.0.0", status: "supported" }],
652 },
653 ],
654 };
655 let invalid = false;
656 return Effect.gen(function* () {
657 const service = yield* ModelManifest.make;
658 assert.deepStrictEqual((yield* service.refresh).compatibility, remote.compatibility);
659 invalid = true;
660 yield* TestClock.adjust("1 hour");
661 assert.deepStrictEqual((yield* service.refresh).compatibility, remote.compatibility);
662 const rebooted = yield* ModelManifest.make;
663 assert.deepStrictEqual((yield* rebooted.current).compatibility, remote.compatibility);
664 }).pipe(
665 Effect.scoped,
666 Effect.provide(
667 serviceLayers({
668 prefix: "model-manifest-compatibility-test",
669 response: () =>
670 Response.json(
671 invalid
672 ? {
673 ...remote,
674 compatibility: [{ ...remote.compatibility![0], recommendedVersion: "3.0.0" }],
675 }
676 : remote,
677 ),
678 }),
679 ),
680 );
681});