authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-09-04 13:33:22-07:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-04 20:33:22+00:00
log9af5139f5974281a59f5cd62c11d918d62126313
treebfb8fa5a300f02c95855148467c7c87e7c5759b4
parent1108be0fc862d5a95374bf0b96518a20e6351025
signature Signed by PGP key B5690EEEBB952194

test(server): keep provider fixture directories host-portable (#9572)

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

2 files changed, 29 insertions(+), 9 deletions(-)

apps/server/src/provider/Layers/ClaudeCapabilitiesProbe.test.ts+21-2
......@@ -1,4 +1,6 @@
1// @effect-diagnostics nodeBuiltinImport:off - cleanup uses Node's retrying rm, which the FileSystem service does not expose.
12import { ClaudeSettings } from "@t3tools/contracts";
3import * as NodeFSP from "node:fs/promises";
24import * as NodeServices from "@effect/platform-node/NodeServices";
35import { assert, it } from "@effect/vitest";
46import * as Effect from "effect/Effect";
......@@ -51,8 +53,25 @@ it.layer(NodeServices.layer)("Claude capability probe SDK boundary", (it) => {
5153 const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-claude-probe-sdk-" });
5254 const executablePath = path.join(tempDir, "fake-claude.mjs");
5355 const invocationPath = path.join(tempDir, "invocation.json");
54 const workspaceCwd = path.join(tempDir, "workspace");
55 yield* fs.makeDirectory(workspaceCwd, { recursive: true });
56 // The probe aborts the SDK without awaiting the child's exit, and on
57 // Windows a directory that is still some process's cwd cannot be
58 // removed. Keep the workspace outside the scoped directory and let it
59 // go with a retrying removal once the child has gone.
60 const workspaceCwd = yield* fs.makeTempDirectory({ prefix: "t3-claude-probe-cwd-" });
61 // Node's own retry rather than an Effect schedule: it.effect runs on a
62 // TestClock, so a scheduled retry would wait for time nobody advances.
63 // If the child still holds the directory after that, an empty temp
64 // directory is left behind rather than failing the test for it.
65 yield* Effect.addFinalizer(() =>
66 Effect.promise(() =>
67 NodeFSP.rm(workspaceCwd, {
68 recursive: true,
69 force: true,
70 maxRetries: 20,
71 retryDelay: 250,
72 }).catch(() => undefined),
73 ),
74 );
5675
5776 yield* fs.writeFileString(
5877 executablePath,
apps/server/src/provider/Layers/CodexCollabRuntime.integration.test.ts+8-7
......@@ -9,6 +9,7 @@
99 */
1010// @effect-diagnostics nodeBuiltinImport:off
1111import * as NodeFS from "node:fs";
12import * as NodeOS from "node:os";
1213import * as NodePath from "node:path";
1314
1415import * as NodeServices from "@effect/platform-node/NodeServices";
......@@ -200,7 +201,7 @@ describe("CodexSessionRuntime collab integration", () => {
200201 const runtime = yield* makeCodexSessionRuntime({
201202 threadId: ThreadId.make("thread-collab-model-activity"),
202203 binaryPath: peerPath,
203 cwd: "/tmp",
204 cwd: NodeOS.tmpdir(),
204205 runtimeMode: "full-access",
205206 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
206207 });
......@@ -292,7 +293,7 @@ describe("CodexSessionRuntime collab integration", () => {
292293 const runtime = yield* makeCodexSessionRuntime({
293294 threadId: ThreadId.make("thread-collab-model-spawn"),
294295 binaryPath: peerPath,
295 cwd: "/tmp",
296 cwd: NodeOS.tmpdir(),
296297 runtimeMode: "full-access",
297298 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
298299 });
......@@ -371,7 +372,7 @@ describe("CodexSessionRuntime collab integration", () => {
371372 const runtime = yield* makeCodexSessionRuntime({
372373 threadId: ThreadId.make(`thread-collab-model-${name}`),
373374 binaryPath: peerPath,
374 cwd: "/tmp",
375 cwd: NodeOS.tmpdir(),
375376 runtimeMode: "full-access",
376377 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
377378 });
......@@ -410,7 +411,7 @@ describe("CodexSessionRuntime collab integration", () => {
410411 const runtime = yield* makeCodexSessionRuntime({
411412 threadId: ThreadId.make("thread-collab-integration"),
412413 binaryPath: peerPath,
413 cwd: "/tmp",
414 cwd: NodeOS.tmpdir(),
414415 runtimeMode: "full-access",
415416 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
416417 });
......@@ -552,7 +553,7 @@ describe("CodexSessionRuntime collab integration", () => {
552553 const runtime = yield* makeCodexSessionRuntime({
553554 threadId: ThreadId.make("thread-collab-stop"),
554555 binaryPath: peerPath,
555 cwd: "/tmp",
556 cwd: NodeOS.tmpdir(),
556557 runtimeMode: "full-access",
557558 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
558559 });
......@@ -630,7 +631,7 @@ describe("CodexSessionRuntime collab integration", () => {
630631 const runtime = yield* makeCodexSessionRuntime({
631632 threadId: ThreadId.make("thread-codex-queued-stop"),
632633 binaryPath: peerPath,
633 cwd: "/tmp",
634 cwd: NodeOS.tmpdir(),
634635 runtimeMode: "full-access",
635636 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
636637 });
......@@ -727,7 +728,7 @@ describe("CodexSessionRuntime collab integration", () => {
727728 const runtime = yield* makeCodexSessionRuntime({
728729 threadId: ThreadId.make("thread-codex-mcp-elicitation"),
729730 binaryPath: peerPath,
730 cwd: "/tmp",
731 cwd: NodeOS.tmpdir(),
731732 runtimeMode: "auto",
732733 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
733734 });