@devries-cameron20 / t3code Mirror · read-only / commits / 9af5139f59
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 10:15 UTC

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

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

Julius Marminge committed Sep 4, 2026 at 13:33 UTC 9af5139f5974281a59f5cd62c11d918d62126313
2 files changed +29 -9
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.
2 import { ClaudeSettings } from "@t3tools/contracts";
3 +import * as NodeFSP from "node:fs/promises";
4 import * as NodeServices from "@effect/platform-node/NodeServices";
5 import { assert, it } from "@effect/vitest";
6 import * as Effect from "effect/Effect";
@@ -51,8 +53,25 @@ it.layer(NodeServices.layer)("Claude capability probe SDK boundary", (it) => {
53 const tempDir = yield* fs.makeTempDirectoryScoped({ prefix: "t3-claude-probe-sdk-" });
54 const executablePath = path.join(tempDir, "fake-claude.mjs");
55 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 + );
75
76 yield* fs.writeFileString(
77 executablePath,
apps/server/src/provider/Layers/CodexCollabRuntime.integration.test.ts
+8 -7
@@ -9,6 +9,7 @@
9 */
10 // @effect-diagnostics nodeBuiltinImport:off
11 import * as NodeFS from "node:fs";
12 +import * as NodeOS from "node:os";
13 import * as NodePath from "node:path";
14
15 import * as NodeServices from "@effect/platform-node/NodeServices";
@@ -200,7 +201,7 @@ describe("CodexSessionRuntime collab integration", () => {
201 const runtime = yield* makeCodexSessionRuntime({
202 threadId: ThreadId.make("thread-collab-model-activity"),
203 binaryPath: peerPath,
203 - cwd: "/tmp",
204 + cwd: NodeOS.tmpdir(),
205 runtimeMode: "full-access",
206 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
207 });
@@ -292,7 +293,7 @@ describe("CodexSessionRuntime collab integration", () => {
293 const runtime = yield* makeCodexSessionRuntime({
294 threadId: ThreadId.make("thread-collab-model-spawn"),
295 binaryPath: peerPath,
295 - cwd: "/tmp",
296 + cwd: NodeOS.tmpdir(),
297 runtimeMode: "full-access",
298 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
299 });
@@ -371,7 +372,7 @@ describe("CodexSessionRuntime collab integration", () => {
372 const runtime = yield* makeCodexSessionRuntime({
373 threadId: ThreadId.make(`thread-collab-model-${name}`),
374 binaryPath: peerPath,
374 - cwd: "/tmp",
375 + cwd: NodeOS.tmpdir(),
376 runtimeMode: "full-access",
377 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
378 });
@@ -410,7 +411,7 @@ describe("CodexSessionRuntime collab integration", () => {
411 const runtime = yield* makeCodexSessionRuntime({
412 threadId: ThreadId.make("thread-collab-integration"),
413 binaryPath: peerPath,
413 - cwd: "/tmp",
414 + cwd: NodeOS.tmpdir(),
415 runtimeMode: "full-access",
416 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
417 });
@@ -552,7 +553,7 @@ describe("CodexSessionRuntime collab integration", () => {
553 const runtime = yield* makeCodexSessionRuntime({
554 threadId: ThreadId.make("thread-collab-stop"),
555 binaryPath: peerPath,
555 - cwd: "/tmp",
556 + cwd: NodeOS.tmpdir(),
557 runtimeMode: "full-access",
558 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
559 });
@@ -630,7 +631,7 @@ describe("CodexSessionRuntime collab integration", () => {
631 const runtime = yield* makeCodexSessionRuntime({
632 threadId: ThreadId.make("thread-codex-queued-stop"),
633 binaryPath: peerPath,
633 - cwd: "/tmp",
634 + cwd: NodeOS.tmpdir(),
635 runtimeMode: "full-access",
636 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
637 });
@@ -727,7 +728,7 @@ describe("CodexSessionRuntime collab integration", () => {
728 const runtime = yield* makeCodexSessionRuntime({
729 threadId: ThreadId.make("thread-codex-mcp-elicitation"),
730 binaryPath: peerPath,
730 - cwd: "/tmp",
731 + cwd: NodeOS.tmpdir(),
732 runtimeMode: "auto",
733 environment: { ...process.env, T3_CODEX_COLLAB_SCRIPT: scriptPath },
734 });