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

textGeneration.test.ts

577 lines21.9 KB

1import { ProviderInstanceId, TextGenerationError } from "@t3tools/contracts";
2import { OpenCodeSettings } from "../settings.ts";
3import * as NodeServices from "@effect/platform-node/NodeServices";
4import { it } from "@effect/vitest";
5import * as Cause from "effect/Cause";
6import * as Deferred from "effect/Deferred";
7import * as Duration from "effect/Duration";
8import * as Effect from "effect/Effect";
9import * as Exit from "effect/Exit";
10import * as Fiber from "effect/Fiber";
11import * as Layer from "effect/Layer";
12import * as Schema from "effect/Schema";
13import * as TestClock from "effect/testing/TestClock";
14import * as NetService from "@t3tools/shared/Net";
15import { beforeEach, expect } from "vite-plus/test";
16​
17import * as TestProviderHost from "@t3tools/provider-testing/TestProviderHost";
18import * as OpenCodeRuntime from "./OpenCodeRuntime.ts";
19import * as OpenCodeServerOwner from "./OpenCodeServerOwner.ts";
20import * as OpenCodeTextGeneration from "./textGeneration.ts";
21import type { ProviderTextGeneration } from "@t3tools/provider-core/server/textGeneration";
22​
23const runtimeMock = {
24 state: {
25 startCalls: [] as string[],
26 promptUrls: [] as string[],
27 promptParts: [] as ReadonlyArray<unknown>[],
28 authHeaders: [] as Array<string | null>,
29 closeCalls: [] as string[],
30 sessionCreateCalls: 0,
31 sessionCalls: [] as string[],
32 onSessionCreate: undefined as ((signal?: AbortSignal) => Promise<never>) | undefined,
33 onPrompt: undefined as
34 | ((signal?: AbortSignal) => Promise<{ data: { parts: ReadonlyArray<unknown> } }>)
35 | undefined,
36 onAbort: undefined as ((signal?: AbortSignal) => Promise<never>) | undefined,
37 connectionError: undefined as Error | undefined,
38 sessionCreateError: undefined as unknown,
39 sessionResult: undefined as { data?: { id: string } } | undefined,
40 promptRequestError: undefined as unknown,
41 promptResult: undefined as
42 | { data?: { info?: { error?: unknown }; parts?: Array<unknown> } }
43 | undefined,
44 },
45 reset() {
46 this.state.startCalls.length = 0;
47 this.state.promptUrls.length = 0;
48 this.state.promptParts.length = 0;
49 this.state.authHeaders.length = 0;
50 this.state.closeCalls.length = 0;
51 this.state.sessionCreateCalls = 0;
52 this.state.sessionCalls.length = 0;
53 this.state.onSessionCreate = undefined;
54 this.state.onPrompt = undefined;
55 this.state.onAbort = undefined;
56 this.state.connectionError = undefined;
57 this.state.sessionCreateError = undefined;
58 this.state.sessionResult = undefined;
59 this.state.promptRequestError = undefined;
60 this.state.promptResult = undefined;
61 },
62};
63​
64const OpenCodeRuntimeTestDouble: OpenCodeRuntime.OpenCodeRuntime["Service"] = {
65 startOpenCodeServerProcess: ({ binaryPath, serverPassword, environment }) =>
66 Effect.gen(function* () {
67 const index = runtimeMock.state.startCalls.length + 1;
68 const url = `http://127.0.0.1:${4_300 + index}`;
69 runtimeMock.state.startCalls.push(binaryPath);
70 yield* Effect.addFinalizer(() =>
71 Effect.sync(() => {
72 runtimeMock.state.closeCalls.push(url);
73 }),
74 );
75 const effectiveServerPassword = OpenCodeRuntime.resolveOpenCodeServerPassword({
76 external: false,
77 ...(serverPassword !== undefined ? { serverPassword } : {}),
78 ...(environment !== undefined ? { environment } : {}),
79 });
80 return {
81 url,
82 ...(effectiveServerPassword !== undefined
83 ? { serverPassword: effectiveServerPassword }
84 : {}),
85 version: "1.14.19",
86 isRunning: Effect.succeed(true),
87 exitCode: Effect.never,
88 };
89 }),
90 connectToOpenCodeServer: ({ serverUrl, serverPassword }) =>
91 runtimeMock.state.connectionError
92 ? Effect.fail(
93 new OpenCodeRuntime.OpenCodeRuntimeError({
94 operation: "global.health",
95 detail: runtimeMock.state.connectionError.message,
96 cause: runtimeMock.state.connectionError,
97 }),
98 )
99 : Effect.succeed({
100 url: serverUrl ?? "http://127.0.0.1:4301",
101 ...(serverPassword ? { serverPassword } : {}),
102 version: "1.14.19",
103 exitCode: null,
104 external: Boolean(serverUrl),
105 }),
106 runOpenCodeCommand: () => Effect.succeed({ stdout: "", stderr: "", code: 0 }),
107 createOpenCodeSdkClient: ({ baseUrl, serverPassword }) =>
108 ({
109 session: {
110 create: async (_input: unknown, options?: { readonly signal?: AbortSignal }) => {
111 runtimeMock.state.sessionCreateCalls += 1;
112 if (runtimeMock.state.onSessionCreate) {
113 return runtimeMock.state.onSessionCreate(options?.signal);
114 }
115 if (runtimeMock.state.sessionCreateError !== undefined) {
116 throw runtimeMock.state.sessionCreateError;
117 }
118 return runtimeMock.state.sessionResult ?? { data: { id: `${baseUrl}/session` } };
119 },
120 abort: async (
121 input: { readonly sessionID: string },
122 options?: { readonly signal?: AbortSignal },
123 ) => {
124 runtimeMock.state.sessionCalls.push(`abort ${input.sessionID}`);
125 if (runtimeMock.state.onAbort) return runtimeMock.state.onAbort(options?.signal);
126 return { data: true };
127 },
128 delete: async (input: { readonly sessionID: string }) => {
129 runtimeMock.state.sessionCalls.push(`delete ${input.sessionID}`);
130 return { data: true };
131 },
132 prompt: async (
133 input: { readonly parts: ReadonlyArray<unknown> },
134 options?: { readonly signal?: AbortSignal },
135 ) => {
136 runtimeMock.state.promptUrls.push(baseUrl);
137 runtimeMock.state.promptParts.push(input.parts);
138 runtimeMock.state.authHeaders.push(
139 serverPassword ? `Basic ${btoa(`opencode:${serverPassword}`)}` : null,
140 );
141 if (runtimeMock.state.onPrompt) return runtimeMock.state.onPrompt(options?.signal);
142 if (runtimeMock.state.promptRequestError !== undefined) {
143 throw runtimeMock.state.promptRequestError;
144 }
145 return (
146 runtimeMock.state.promptResult ?? {
147 data: {
148 parts: [
149 {
150 type: "text",
151 text: JSON.stringify({
152 subject: "Improve OpenCode reuse",
153 body: "Reuse one server for the full action.",
154 }),
155 },
156 ],
157 },
158 }
159 );
160 },
161 },
162 }) as unknown as ReturnType<
163 OpenCodeRuntime.OpenCodeRuntime["Service"]["createOpenCodeSdkClient"]
164 >,
165 loadOpenCodeInventory: () =>
166 Effect.fail(
167 new OpenCodeRuntime.OpenCodeRuntimeError({
168 operation: "loadOpenCodeInventory",
169 detail: "OpenCodeRuntimeTestDouble.loadOpenCodeInventory not used in this test",
170 cause: null,
171 }),
172 ),
173 loadOpenCodeSkills: () => Effect.succeed([]),
174};
175​
176const DEFAULT_TEST_MODEL_SELECTION = {
177 instanceId: ProviderInstanceId.make("opencode"),
178 model: "openai/gpt-5",
179};
180const DEFAULT_COMMIT_MESSAGE_INPUT = {
181 cwd: process.cwd(),
182 branch: "feature/opencode-reuse",
183 stagedSummary: "M README.md",
184 stagedPatch: "diff --git a/README.md b/README.md",
185 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
186};
187​
188const OPENCODE_TEXT_GENERATION_IDLE_TTL_MS = 30_000;
189​
190const layerOpenCodeTextGenerationTest = Layer.succeed(
191 OpenCodeRuntime.OpenCodeRuntime,
192 OpenCodeRuntimeTestDouble,
193).pipe(
194 Layer.provideMerge(TestProviderHost.layer()),
195 Layer.provideMerge(NetService.layer),
196 Layer.provideMerge(NodeServices.layer),
197);
198​
199const layerOpenCodeTextGenerationExistingServerTest = Layer.succeed(
200 OpenCodeRuntime.OpenCodeRuntime,
201 OpenCodeRuntimeTestDouble,
202).pipe(
203 Layer.provideMerge(TestProviderHost.layer()),
204 Layer.provideMerge(NetService.layer),
205 Layer.provideMerge(NodeServices.layer),
206);
207​
208const DEFAULT_OPENCODE_SETTINGS = Schema.decodeSync(OpenCodeSettings)({
209 binaryPath: "fake-opencode",
210});
211const EXISTING_SERVER_OPENCODE_SETTINGS = Schema.decodeSync(OpenCodeSettings)({
212 binaryPath: "fake-opencode",
213 serverUrl: "http://127.0.0.1:9999",
214 serverPassword: "secret-password",
215});
216const EXTERNAL_SERVER_WITHOUT_AUTH_OPENCODE_SETTINGS = Schema.decodeSync(OpenCodeSettings)({
217 binaryPath: "fake-opencode",
218 serverUrl: "http://127.0.0.1:9999",
219});
220​
221function withOpenCodeTextGeneration<A, E, R>(
222 settings: OpenCodeSettings,
223 effectFn: (textGeneration: ProviderTextGeneration) => Effect.Effect<A, E, R>,
224 environment?: NodeJS.ProcessEnv,
225) {
226 return Effect.gen(function* () {
227 const serverOwner = yield* OpenCodeServerOwner.make({
228 binaryPath: settings.binaryPath,
229 directory: process.cwd(),
230 ...(settings.serverPassword ? { serverPassword: settings.serverPassword } : {}),
231 ...(environment ? { environment } : {}),
232 });
233 const textGeneration = yield* OpenCodeTextGeneration.makeOpenCodeTextGeneration(settings).pipe(
234 Effect.provideService(OpenCodeServerOwner.OpenCodeServerOwner, serverOwner),
235 );
236 return yield* effectFn(textGeneration);
237 }).pipe(Effect.scoped);
239​
240beforeEach(() => {
241 runtimeMock.reset();
242});
243​
244const advanceIdleClock = Effect.gen(function* () {
245 yield* Effect.yieldNow;
246 yield* TestClock.adjust(Duration.millis(OPENCODE_TEXT_GENERATION_IDLE_TTL_MS + 1));
247 yield* Effect.yieldNow;
248});
249​
250it.layer(layerOpenCodeTextGenerationTest)("OpenCodeTextGeneration", (it) => {
251 it.effect("cancels or times out an in-flight session creation before prompting", () =>
252 withOpenCodeTextGeneration(EXISTING_SERVER_OPENCODE_SETTINGS, (textGeneration) =>
253 Effect.gen(function* () {
254 const timedOut = yield* Deferred.make<AbortSignal | undefined>();
255 runtimeMock.state.onSessionCreate = (signal) => {
256 Deferred.doneUnsafe(timedOut, Effect.succeed(signal));
257 return new Promise<never>(() => {});
258 };
259 const timedOutFiber = yield* textGeneration
260 .generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
261 .pipe(Effect.forkChild);
262 const timedOutSignal = yield* Deferred.await(timedOut);
263 yield* TestClock.adjust(Duration.minutes(3));
264 const timeoutError = yield* Fiber.join(timedOutFiber).pipe(Effect.flip);
265 expect(timeoutError).toBeInstanceOf(TextGenerationError);
266 expect(timeoutError.detail).toBe("OpenCode did not finish generating in time.");
267 expect(timedOutSignal?.aborted).toBe(true);
268​
269 const started = yield* Deferred.make<AbortSignal | undefined>();
270 runtimeMock.state.onSessionCreate = (signal) => {
271 Deferred.doneUnsafe(started, Effect.succeed(signal));
272 return new Promise<never>(() => {});
273 };
274 const fiber = yield* textGeneration
275 .generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
276 .pipe(Effect.forkChild);
277 const signal = yield* Deferred.await(started);
278 yield* Fiber.interrupt(fiber);
279​
280 const exit = yield* Fiber.await(fiber);
281 expect(Exit.isFailure(exit) && Cause.hasInterruptsOnly(exit.cause)).toBe(true);
282 expect(signal?.aborted).toBe(true);
283 expect(runtimeMock.state.promptUrls).toEqual([]);
284 expect(runtimeMock.state.sessionCalls).toEqual([]);
285 }),
286 ),
287 );
288​
289 it.effect("cancels only its prompt session while another generation uses the shared server", () =>
290 withOpenCodeTextGeneration(DEFAULT_OPENCODE_SETTINGS, (textGeneration) =>
291 Effect.gen(function* () {
292 const started = yield* Deferred.make<AbortSignal | undefined>();
293 runtimeMock.state.sessionResult = { data: { id: "cancelled-session" } };
294 runtimeMock.state.onPrompt = (signal) => {
295 Deferred.doneUnsafe(started, Effect.succeed(signal));
296 return new Promise<never>(() => {});
297 };
298 const fiber = yield* textGeneration
299 .generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
300 .pipe(Effect.forkChild);
301 const signal = yield* Deferred.await(started);
302​
303 const otherStarted = yield* Deferred.make<AbortSignal | undefined>();
304 const otherReply = Promise.withResolvers<{ data: { parts: ReadonlyArray<unknown> } }>();
305 runtimeMock.state.sessionResult = { data: { id: "other-session" } };
306 runtimeMock.state.onPrompt = (otherSignal) => {
307 Deferred.doneUnsafe(otherStarted, Effect.succeed(otherSignal));
308 return otherReply.promise;
309 };
310 const otherFiber = yield* textGeneration
311 .generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
312 .pipe(Effect.forkChild);
313 const otherSignal = yield* Deferred.await(otherStarted);
314 yield* Fiber.interrupt(fiber);
315​
316 const exit = yield* Fiber.await(fiber);
317 expect(Exit.isFailure(exit) && Cause.hasInterruptsOnly(exit.cause)).toBe(true);
318 expect(signal?.aborted).toBe(true);
319 expect(otherSignal?.aborted).toBe(false);
320 expect(runtimeMock.state.sessionCalls).toEqual([
321 "abort cancelled-session",
322 "delete cancelled-session",
323 ]);
324 expect(runtimeMock.state.closeCalls).toEqual([]);
325​
326 otherReply.resolve({
327 data: {
328 parts: [{ type: "text", text: '{"subject":"Other generation completed","body":""}' }],
329 },
330 });
331 expect((yield* Fiber.join(otherFiber)).subject).toBe("Other generation completed");
332 expect(runtimeMock.state.startCalls).toEqual(["fake-opencode"]);
333 expect(runtimeMock.state.promptUrls).toEqual([
334 "http://127.0.0.1:4301",
335 "http://127.0.0.1:4301",
336 ]);
337 expect(runtimeMock.state.sessionCalls).toEqual([
338 "abort cancelled-session",
339 "delete cancelled-session",
340 "delete other-session",
341 ]);
342 expect(runtimeMock.state.closeCalls).toEqual([]);
343 }),
344 ),
345 );
346​
347 it.effect("excludes generic files from thread title generation", () =>
348 withOpenCodeTextGeneration(DEFAULT_OPENCODE_SETTINGS, (textGeneration) =>
349 Effect.gen(function* () {
350 runtimeMock.state.promptResult = {
351 data: {
352 parts: [{ type: "text", text: '{"title":"Review uploaded report"}' }],
353 },
354 };
355​
356 yield* textGeneration.generateThreadTitle({
357 cwd: process.cwd(),
358 message: "Review these attachments.",
359 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
360 attachments: [
361 {
362 type: "image",
363 id: "thread-image-attachment",
364 name: "screenshot.png",
365 mimeType: "image/png",
366 sizeBytes: 3,
367 },
368 {
369 type: "file",
370 id: "thread-report-attachment-pdf",
371 name: "report.pdf",
372 mimeType: "application/pdf",
373 sizeBytes: 42,
374 },
375 ],
376 });
377​
378 expect(runtimeMock.state.promptParts[0]).toEqual([
379 expect.objectContaining({ type: "text" }),
380 expect.objectContaining({ type: "file", filename: "screenshot.png" }),
381 ]);
382 }),
383 ),
384 );
385​
386 it.effect("gives up and aborts the session when a prompt never settles", () =>
387 withOpenCodeTextGeneration(DEFAULT_OPENCODE_SETTINGS, (textGeneration) =>
388 Effect.gen(function* () {
389 const started = yield* Deferred.make<AbortSignal | undefined>();
390 let sessionAborts = 0;
391 runtimeMock.state.onPrompt = (signal) => {
392 Deferred.doneUnsafe(started, Effect.succeed(signal));
393 return new Promise<never>(() => {});
394 };
395 runtimeMock.state.onAbort = () => {
396 sessionAborts += 1;
397 return Promise.reject(new Error("abort observed"));
398 };
399 const fiber = yield* textGeneration
400 .generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
401 .pipe(Effect.forkChild);
402 const signal = yield* Deferred.await(started);
403 yield* TestClock.adjust(Duration.minutes(3));
404​
405 const error = yield* Fiber.join(fiber).pipe(Effect.flip);
406 expect(error).toBeInstanceOf(TextGenerationError);
407 expect(error.detail).toBe("OpenCode did not finish generating in time.");
408 expect(signal?.aborted).toBe(true);
409 expect(sessionAborts).toBe(1);
410 }),
411 ),
412 );
413​
414 it.effect("uses an environment-only password for a locally spawned server", () =>
415 withOpenCodeTextGeneration(
416 DEFAULT_OPENCODE_SETTINGS,
417 (textGeneration) =>
418 Effect.gen(function* () {
419 yield* textGeneration.generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT);
420​
421 expect(runtimeMock.state.authHeaders).toEqual([
422 `Basic ${btoa("opencode:environment-password")}`,
423 ]);
424 }),
425 { OPENCODE_SERVER_PASSWORD: "environment-password" },
426 ),
427 );
428​
429 it.effect("returns a typed empty-output error for malformed and blank response parts", () =>
430 withOpenCodeTextGeneration(DEFAULT_OPENCODE_SETTINGS, (textGeneration) =>
431 Effect.gen(function* () {
432 runtimeMock.state.promptResult = {
433 data: {
434 parts: [null, { type: "tool" }, { type: "text", text: " " }],
435 },
436 };
437​
438 const error = yield* textGeneration
439 .generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
440 .pipe(Effect.flip);
441​
442 expect(error.message).toContain("OpenCode returned empty output.");
443 expect(error.cause).toMatchObject({
444 _tag: "OpenCodeTextGenerationEmptyOutputError",
445 operation: "generateCommitMessage",
446 cwd: process.cwd(),
447 sessionId: "http://127.0.0.1:4301/session",
448 providerId: "openai",
449 modelId: "gpt-5",
450 responsePartCount: 3,
451 textPartCount: 1,
452 });
453 expect(error.cause).not.toHaveProperty("cause");
454 expect(runtimeMock.state.sessionCalls).toEqual(["delete http://127.0.0.1:4301/session"]);
455 }),
456 ),
457 );
458​
459 it.effect("deletes the session when the prompt request rejects", () =>
460 withOpenCodeTextGeneration(DEFAULT_OPENCODE_SETTINGS, (textGeneration) =>
461 Effect.gen(function* () {
462 runtimeMock.state.promptRequestError = new Error("prompt transport failed");
463​
464 const error = yield* textGeneration
465 .generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
466 .pipe(Effect.flip);
467​
468 expect(error.detail).toBe("OpenCode session.prompt request failed.");
469 expect(runtimeMock.state.sessionCalls).toEqual(["delete http://127.0.0.1:4301/session"]);
470 }),
471 ),
472 );
473​
474 it.effect("parses JSON returned as plain text output", () =>
475 withOpenCodeTextGeneration(DEFAULT_OPENCODE_SETTINGS, (textGeneration) =>
476 Effect.gen(function* () {
477 runtimeMock.state.promptResult = {
478 data: {
479 parts: [
480 {
481 type: "text",
482 text: 'Here is the result:\n{"subject":"Tighten OpenCode parsing","body":"Handle JSON text output locally."}',
483 },
484 ],
485 },
486 };
487​
488 const result = yield* textGeneration.generateCommitMessage({
489 cwd: process.cwd(),
490 branch: "feature/opencode-reuse",
491 stagedSummary: "M README.md",
492 stagedPatch: "diff --git a/README.md b/README.md",
493 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
494 });
495​
496 expect(result).toEqual({
497 subject: "Tighten OpenCode parsing",
498 body: "Handle JSON text output locally.",
499 });
500 }),
501 ),
502 );
503});
504​
505it.layer(layerOpenCodeTextGenerationExistingServerTest)(
506 "OpenCodeTextGeneration with configured server URL",
507 (it) => {
508 it.effect("does not send a local environment password to a configured server", () =>
509 withOpenCodeTextGeneration(
510 EXTERNAL_SERVER_WITHOUT_AUTH_OPENCODE_SETTINGS,
511 (textGeneration) =>
512 Effect.gen(function* () {
513 yield* textGeneration.generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT);
514 expect(runtimeMock.state.authHeaders).toEqual([null]);
515 }),
516 { OPENCODE_SERVER_PASSWORD: "local-secret" },
517 ),
518 );
519​
520 it.effect("does not create a session when the server version is unsupported", () =>
521 withOpenCodeTextGeneration(EXISTING_SERVER_OPENCODE_SETTINGS, (textGeneration) =>
522 Effect.gen(function* () {
523 runtimeMock.state.connectionError = new Error(
524 "OpenCode v1.14.18 is too old. Upgrade to v1.14.19 or newer.",
525 );
526​
527 const error = yield* textGeneration
528 .generateCommitMessage(DEFAULT_COMMIT_MESSAGE_INPUT)
529 .pipe(Effect.flip);
530​
531 expect(error).toBeInstanceOf(TextGenerationError);
532 expect(error.message).toContain("v1.14.18 is too old");
533 expect(runtimeMock.state.sessionCreateCalls).toBe(0);
534 }),
535 ),
536 );
537​
538 it.effect("reuses a configured OpenCode server URL without spawning or applying idle TTL", () =>
539 withOpenCodeTextGeneration(EXISTING_SERVER_OPENCODE_SETTINGS, (textGeneration) =>
540 Effect.gen(function* () {
541 yield* textGeneration.generateCommitMessage({
542 cwd: process.cwd(),
543 branch: "feature/opencode-reuse",
544 stagedSummary: "M README.md",
545 stagedPatch: "diff --git a/README.md b/README.md",
546 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
547 });
548 yield* textGeneration.generateCommitMessage({
549 cwd: process.cwd(),
550 branch: "feature/opencode-reuse",
551 stagedSummary: "M README.md",
552 stagedPatch: "diff --git a/README.md b/README.md",
553 modelSelection: DEFAULT_TEST_MODEL_SELECTION,
554 });
555​
556 expect(runtimeMock.state.startCalls).toEqual([]);
557 expect(runtimeMock.state.sessionCalls).toEqual([
558 "delete http://127.0.0.1:9999/session",
559 "delete http://127.0.0.1:9999/session",
560 ]);
561 expect(runtimeMock.state.promptUrls).toEqual([
562 "http://127.0.0.1:9999",
563 "http://127.0.0.1:9999",
564 ]);
565 expect(runtimeMock.state.authHeaders).toEqual([
566 `Basic ${btoa("opencode:secret-password")}`,
567 `Basic ${btoa("opencode:secret-password")}`,
568 ]);
569​
570 yield* advanceIdleClock;
571​
572 expect(runtimeMock.state.closeCalls).toEqual([]);
573 }),
574 ).pipe(Effect.provide(TestClock.layer())),
575 );
576 },
577);