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,4 +1,6 @@
1// @effect-diagnostics nodeBuiltinImport:off - cleanup uses Node's retrying rm, which the FileSystem service does not expose.
1import { ClaudeSettings } from "@t3tools/contracts";2import { ClaudeSettings } from "@t3tools/contracts";
3import * as NodeFSP from "node:fs/promises";
2import * as NodeServices from "@effect/platform-node/NodeServices";4import * as NodeServices from "@effect/platform-node/NodeServices";
3import { assert, it } from "@effect/vitest";5import { assert, it } from "@effect/vitest";
4import * as Effect from "effect/Effect";6import * as Effect from "effect/Effect";
...@@ -51,8 +53,25 @@ it.layer(NodeServices.layer)("Claude capability probe SDK boundary", (it) => {...@@ -51,8 +53,25 @@ it.layer(NodeServices.layer)("Claude capability probe SDK boundary", (it) => {
51 const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-claude-probe-sdk-" });53 const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-claude-probe-sdk-" });
52 const executablePath = path.join(tempDir, "fake-claude.mjs");54 const executablePath = path.join(tempDir, "fake-claude.mjs");
53 const invocationPath = path.join(tempDir, "invocation.json");55 const invocationPath = path.join(tempDir, "invocation.json");
54 const workspaceCwd = path.join(tempDir, "workspace");56 // The probe aborts the SDK without awaiting the child's exit, and on
55 yield* fs.makeDirectory(workspaceCwd, { recursive: true });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
57 yield* fs.writeFileString(76 yield* fs.writeFileString(
58 executablePath,77 executablePath,
apps/server/src/provider/Layers/CodexCollabRuntime.integration.test.ts+8-7
...@@ -9,6 +9,7 @@...@@ -9,6 +9,7 @@
9 */9 */
10// @effect-diagnostics nodeBuiltinImport:off10// @effect-diagnostics nodeBuiltinImport:off
11import * as NodeFS from "node:fs";11import * as NodeFS from "node:fs";
12import * as NodeOS from "node:os";
12import * as NodePath from "node:path";13import * as NodePath from "node:path";
1314
14import * as NodeServices from "@effect/platform-node/NodeServices";15import * as NodeServices from "@effect/platform-node/NodeServices";
...@@ -200,7 +201,7 @@ describe("CodexSessionRuntime collab integration", () => {...@@ -200,7 +201,7 @@ describe("CodexSessionRuntime collab integration", () => {
200 const runtime = yield* makeCodexSessionRuntime({201 const runtime = yield* makeCodexSessionRuntime({
201 threadId: ThreadId.make("thread-collab-model-activity"),202 threadId: ThreadId.make("thread-collab-model-activity"),
202 binaryPath: peerPath,203 binaryPath: peerPath,
203 cwd: "/tmp",204 cwd: NodeOS.tmpdir(),
204 runtimeMode: "full-access",205 runtimeMode: "full-access",
205 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },206 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
206 });207 });
...@@ -292,7 +293,7 @@ describe("CodexSessionRuntime collab integration", () => {...@@ -292,7 +293,7 @@ describe("CodexSessionRuntime collab integration", () => {
292 const runtime = yield* makeCodexSessionRuntime({293 const runtime = yield* makeCodexSessionRuntime({
293 threadId: ThreadId.make("thread-collab-model-spawn"),294 threadId: ThreadId.make("thread-collab-model-spawn"),
294 binaryPath: peerPath,295 binaryPath: peerPath,
295 cwd: "/tmp",296 cwd: NodeOS.tmpdir(),
296 runtimeMode: "full-access",297 runtimeMode: "full-access",
297 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },298 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
298 });299 });
...@@ -371,7 +372,7 @@ describe("CodexSessionRuntime collab integration", () => {...@@ -371,7 +372,7 @@ describe("CodexSessionRuntime collab integration", () => {
371 const runtime = yield* makeCodexSessionRuntime({372 const runtime = yield* makeCodexSessionRuntime({
372 threadId: ThreadId.make(`thread-collab-model-${name}`),373 threadId: ThreadId.make(`thread-collab-model-${name}`),
373 binaryPath: peerPath,374 binaryPath: peerPath,
374 cwd: "/tmp",375 cwd: NodeOS.tmpdir(),
375 runtimeMode: "full-access",376 runtimeMode: "full-access",
376 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },377 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
377 });378 });
...@@ -410,7 +411,7 @@ describe("CodexSessionRuntime collab integration", () => {...@@ -410,7 +411,7 @@ describe("CodexSessionRuntime collab integration", () => {
410 const runtime = yield* makeCodexSessionRuntime({411 const runtime = yield* makeCodexSessionRuntime({
411 threadId: ThreadId.make("thread-collab-integration"),412 threadId: ThreadId.make("thread-collab-integration"),
412 binaryPath: peerPath,413 binaryPath: peerPath,
413 cwd: "/tmp",414 cwd: NodeOS.tmpdir(),
414 runtimeMode: "full-access",415 runtimeMode: "full-access",
415 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },416 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
416 });417 });
...@@ -552,7 +553,7 @@ describe("CodexSessionRuntime collab integration", () => {...@@ -552,7 +553,7 @@ describe("CodexSessionRuntime collab integration", () => {
552 const runtime = yield* makeCodexSessionRuntime({553 const runtime = yield* makeCodexSessionRuntime({
553 threadId: ThreadId.make("thread-collab-stop"),554 threadId: ThreadId.make("thread-collab-stop"),
554 binaryPath: peerPath,555 binaryPath: peerPath,
555 cwd: "/tmp",556 cwd: NodeOS.tmpdir(),
556 runtimeMode: "full-access",557 runtimeMode: "full-access",
557 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },558 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
558 });559 });
...@@ -630,7 +631,7 @@ describe("CodexSessionRuntime collab integration", () => {...@@ -630,7 +631,7 @@ describe("CodexSessionRuntime collab integration", () => {
630 const runtime = yield* makeCodexSessionRuntime({631 const runtime = yield* makeCodexSessionRuntime({
631 threadId: ThreadId.make("thread-codex-queued-stop"),632 threadId: ThreadId.make("thread-codex-queued-stop"),
632 binaryPath: peerPath,633 binaryPath: peerPath,
633 cwd: "/tmp",634 cwd: NodeOS.tmpdir(),
634 runtimeMode: "full-access",635 runtimeMode: "full-access",
635 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },636 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
636 });637 });
...@@ -727,7 +728,7 @@ describe("CodexSessionRuntime collab integration", () => {...@@ -727,7 +728,7 @@ describe("CodexSessionRuntime collab integration", () => {
727 const runtime = yield* makeCodexSessionRuntime({728 const runtime = yield* makeCodexSessionRuntime({
728 threadId: ThreadId.make("thread-codex-mcp-elicitation"),729 threadId: ThreadId.make("thread-codex-mcp-elicitation"),
729 binaryPath: peerPath,730 binaryPath: peerPath,
730 cwd: "/tmp",731 cwd: NodeOS.tmpdir(),
731 runtimeMode: "auto",732 runtimeMode: "auto",
732 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },733 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
733 });734 });