The best way to control Claude Code, Codex and more from any computer or phone
test(server): correct Windows path and settings assertions (#30983)
Elliot Drel committed
Nov 5, 2026 at 15:23 UTC
268e5810cd69393be362d5062d456f45e21b8492
3 files changed
+27
-15
apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
+22
-10
@@ -2056,7 +2056,7 @@ describe("ClaudeAdapterV2 attachments", () => {
2056
yield* deliver;
2057
const retried = offeredMessages.at(-1)!.message.content;
2058
assert.notInclude(JSON.stringify(retried), '"type":"document"');
2059
- assert.include(JSON.stringify(retried), documentPath);
2059
+ assert.include(JSON.stringify(retried), JSON.stringify(documentPath).slice(1, -1));
2060
assert.isBelow(Buffer.byteLength(JSON.stringify(offeredMessages)), 32_000_000);
2061
return;
2062
}
@@ -2105,7 +2105,7 @@ describe("ClaudeAdapterV2 attachments", () => {
2105
typeof sent === "string" ? [] : sent.filter((block) => block.type === "image"),
2106
budget === "partial-images" ? 1 : 0,
2107
);
2108
- assert.include(JSON.stringify(sent), imagePath);
2108
+ assert.include(JSON.stringify(sent), JSON.stringify(imagePath).slice(1, -1));
2109
yield* runtime.steerTurn({
2110
threadId,
2111
runId: RunId.make("run-claude-attachments"),
@@ -2124,7 +2124,7 @@ describe("ClaudeAdapterV2 attachments", () => {
2124
: steered.filter((block) => block.type === "image"),
2125
0,
2126
);
2127
- assert.include(JSON.stringify(steered), imagePath);
2127
+ assert.include(JSON.stringify(steered), JSON.stringify(imagePath).slice(1, -1));
2128
assert.isBelow(
2129
Buffer.byteLength(
2130
JSON.stringify(offeredMessages.map((message) => message.message)),
@@ -2186,7 +2186,7 @@ describe("ClaudeAdapterV2 attachments", () => {
2186
0,
2187
budget,
2188
);
2189
- assert.include(JSON.stringify(sent), documentPath);
2189
+ assert.include(JSON.stringify(sent), JSON.stringify(documentPath).slice(1, -1));
2190
return;
2191
}
2192
if (!resumed) {
@@ -2399,7 +2399,7 @@ describe("ClaudeAdapterV2 attachments", () => {
2399
);
2400
if (scenario === "text-only")
2401
assert.equal(sent, ultrathink ? "Ultrathink:\nContinue." : "Continue.");
2402
- else assert.include(JSON.stringify(sent), documentPath);
2402
+ else assert.include(JSON.stringify(sent), JSON.stringify(documentPath).slice(1, -1));
2403
}
2404
}).pipe(
2405
Effect.provide(
@@ -4459,8 +4459,8 @@ describe("ClaudeAdapterV2 background wake turns", () => {
4459
"false",
4460
);
4461
4462
- // Claude Code keeps the local file at the repository root, the main checkout's root in a
4463
- // worktree, and that file beats the user's settings.
4462
+ // POSIX resolves local settings at the repository root; Windows uses cwd.
4463
+ // Local settings beat user settings wherever they are found.
4464
const repo = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-claude-repo-" });
4465
const worktree = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-claude-wt-" });
4466
const worktreeGitDir = path.join(repo, ".git", "worktrees", "wt");
@@ -4478,11 +4478,23 @@ describe("ClaudeAdapterV2 background wake turns", () => {
4478
`{"env":{"ENABLE_TOOL_SEARCH":"${value}"}}`,
4479
);
4480
const userAuto = '{"env":{"ENABLE_TOOL_SEARCH":"auto"}}';
4481
+ const platform = yield* HostProcess.Platform;
4482
yield* rootLocal("auto");
4482
- assert.equal(yield* openedToolSearch("{}", worktree), "true");
4483
+ assert.equal(yield* openedToolSearch("{}", repo), "true");
4484
+ assert.equal(
4485
+ yield* openedToolSearch("{}", worktree),
4486
+ platform === "win32" ? undefined : "true",
4487
+ );
4488
yield* rootLocal("false");
4484
- assert.isUndefined(yield* openedToolSearch(userAuto, worktree));
4485
- assert.isUndefined(yield* openedToolSearch(userAuto, path.join(repo, "packages", "app")));
4489
+ assert.isUndefined(yield* openedToolSearch(userAuto, repo));
4490
+ assert.equal(
4491
+ yield* openedToolSearch(userAuto, worktree),
4492
+ platform === "win32" ? "true" : undefined,
4493
+ );
4494
+ assert.equal(
4495
+ yield* openedToolSearch(userAuto, path.join(repo, "packages", "app")),
4496
+ platform === "win32" ? "true" : undefined,
4497
+ );
4498
4499
// Project settings beat user settings, and the process env applies only when no file sets it.
4500
const project = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-claude-project-" });
apps/server/src/provider/Drivers/CodexDriver.test.ts
+1
-1
@@ -253,7 +253,7 @@ it.layer(layerTest)("CodexDriver", (it) => {
253
expect(restored.auth.email).toBe("account@example.test");
254
expect(restored.runtimePaths?.homePath).toBe(sharedHome);
255
expect(restored.runtimePaths?.shadowHomePath).toContain(
256
- `providers/codex/${instanceId}/shadow`,
256
+ NodePath.join("providers", "codex", instanceId, "shadow"),
257
);
258
const scan = yield* instance.snapshotForCwd!(serverConfig.stateDir).pipe(Effect.exit);
259
expect(Exit.isFailure(scan)).toBe(true);
apps/server/src/provider/userInputAttachments.test.ts
+4
-4
@@ -293,7 +293,7 @@ describe("question answer paths", () => {
293
attachmentsDir: config.attachmentsDir,
294
attachmentsByQuestionId: { q: [file] },
295
});
296
- expect(answers.q).toContain(`text extracted to: "${path}.txt"`);
296
+ expect(answers.q).toContain(`text extracted to: ${JSON.stringify(path + ".txt")}`);
297
expect(NodeFS.readFileSync(`${path}.txt`, "utf8")).toContain("Vessel: Larkspur");
298
expect(NodeFS.readFileSync(`${path}.txt`, "utf8")).toContain("301");
299
expect(NodeFS.readFileSync(`${path}.txt`, "utf8")).toContain("42");
@@ -354,7 +354,7 @@ describe("question answer paths", () => {
354
attachmentsDir: config.attachmentsDir,
355
attachmentsByQuestionId: { q: [file] },
356
});
357
- expect(answers.q).toContain(path);
357
+ expect(answers.q).toContain(JSON.stringify(path));
358
expect(answers.q).not.toContain("text extracted");
359
expect(NodeFS.existsSync(`${path}.txt`)).toBe(false);
360
expect(NodeFS.readFileSync(path, "utf8")).toBe("invalid document");
@@ -1146,7 +1146,7 @@ describe("question answer paths", () => {
1146
expect(answers.q).toEqual([
1147
"First",
1148
"Second",
1149
- `Attached file "spec \\"final\\".txt": "${path}"`,
1149
+ `Attached file "spec \\"final\\".txt": ${JSON.stringify(path)}`,
1150
]);
1151
expect(answers.other).toBe("No file");
1152
expect(original.q).toEqual(["First", "Second"]);
@@ -1157,7 +1157,7 @@ describe("question answer paths", () => {
1157
attachmentsByQuestionId: { ["__proto__"]: [attachment] },
1158
});
1159
expect(Object.keys(specialKey)).toEqual(["__proto__"]);
1160
- expect(specialKey["__proto__"]).toContain(path);
1160
+ expect(specialKey["__proto__"]).toContain(JSON.stringify(path));
1161
}).pipe(Effect.provide(layer)),
1162
);
1163
it.effect("does not send an unavailable attachment path", () =>