GeezerVison is showing github.com — test(server): Windows paths and settings lookup no longer break server tests by juliusmarminge · Pull Request #30984 · pingdotgg/t3code
test(server): Windows paths and settings lookup no longer break server tests
#30984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement . We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Uh oh!
There was an error while loading. Please reload this page.
Show file tree
Hide file tree
Changes from all commits
Commits
File filter
Filter by extension
.ts
(3)
All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Hide whitespace
Diff view
Hide whitespace
There are no files selected for viewing
Original file line number
Diff line number
Diff line change
Expand Up
@@ -1782,6 +1782,11 @@ describe("ClaudeAdapterV2 resume compaction", () => {
);
});
const sdkMessageText = (content: SDKUserMessage["message"]["content"]) =>
typeof content === "string"
? content
: content.flatMap((block) => (block.type === "text" ? [block.text] : [])).join("\n");
describe("ClaudeAdapterV2 attachments", () => {
it.effect.each([
...[
Expand Down
Expand Up
@@ -2035,7 +2040,7 @@ describe("ClaudeAdapterV2 attachments", () => {
yield* deliver;
const retried = offeredMessages.at(-1)!.message.content;
assert.notInclude(JSON.stringify(retried), '"type":"document"');
assert.include(JSON.stringify (retried), documentPath);
assert.include(sdkMessageText (retried), documentPath);
assert.isBelow(Buffer.byteLength(JSON.stringify(offeredMessages)), 32_000_000);
return;
}
Expand Down
Expand Up
@@ -2084,7 +2089,7 @@ describe("ClaudeAdapterV2 attachments", () => {
typeof sent === "string" ? [] : sent.filter((block) => block.type === "image"),
budget === "partial-images" ? 1 : 0,
);
assert.include(JSON.stringify (sent), imagePath);
assert.include(sdkMessageText (sent), imagePath);
yield* runtime.steerTurn({
threadId,
runId: RunId.make("run-claude-attachments"),
Expand All
@@ -2103,7 +2108,7 @@ describe("ClaudeAdapterV2 attachments", () => {
: steered.filter((block) => block.type === "image"),
0,
);
assert.include(JSON.stringify (steered), imagePath);
assert.include(sdkMessageText (steered), imagePath);
assert.isBelow(
Buffer.byteLength(
JSON.stringify(offeredMessages.map((message) => message.message)),
Expand Down
Expand Up
@@ -2165,7 +2170,7 @@ describe("ClaudeAdapterV2 attachments", () => {
0,
budget,
);
assert.include(JSON.stringify (sent), documentPath);
assert.include(sdkMessageText (sent), documentPath);
return;
}
if (!resumed) {
Expand Down
Expand Up
@@ -2378,7 +2383,7 @@ describe("ClaudeAdapterV2 attachments", () => {
);
if (scenario === "text-only")
assert.equal(sent, ultrathink ? "Ultrathink:\nContinue." : "Continue.");
else assert.include(JSON.stringify (sent), documentPath);
else assert.include(sdkMessageText (sent), documentPath);
}
}).pipe(
Effect.provide(
Expand Down
Expand Up
@@ -4433,11 +4438,24 @@ describe("ClaudeAdapterV2 background wake turns", () => {
`{"env":{"ENABLE_TOOL_SEARCH":"${value}"}}`,
);
const userAuto = '{"env":{"ENABLE_TOOL_SEARCH":"auto"}}';
yield* rootLocal("auto");
assert.equal(yield* openedToolSearch("{}", worktree), "true");
yield* rootLocal("false");
assert.isUndefined(yield* openedToolSearch(userAuto, worktree));
assert.isUndefined(yield* openedToolSearch(userAuto, path.join(repo, "packages", "app")));
if ((yield* HostProcess.Platform) === "win32") {
// On Windows the local file is read from cwd only, never from the repository root.
yield* rootLocal("auto");
assert.isUndefined(yield* openedToolSearch("{}", worktree));
assert.isUndefined(yield* openedToolSearch("{}", path.join(repo, "packages", "app")));
yield* fileSystem.makeDirectory(path.join(worktree, ".claude"));
yield* fileSystem.writeFileString(
path.join(worktree, ".claude", "settings.local.json"),
'{"env":{"ENABLE_TOOL_SEARCH":"false"}}',
);
assert.isUndefined(yield* openedToolSearch(userAuto, worktree));
} else {
yield* rootLocal("auto");
assert.equal(yield* openedToolSearch("{}", worktree), "true");
yield* rootLocal("false");
assert.isUndefined(yield* openedToolSearch(userAuto, worktree));
assert.isUndefined(yield* openedToolSearch(userAuto, path.join(repo, "packages", "app")));
}
// Project settings beat user settings, and the process env applies only when no file sets it.
const project = yield* fileSystem.makeTempDirectoryScoped({ prefix: "t3-claude-project-" });
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -253,7 +253,7 @@ it.layer(layerTest)("CodexDriver", (it) => {
expect(restored.auth.email).toBe("[email protected] ");
expect(restored.runtimePaths?.homePath).toBe(sharedHome);
expect(restored.runtimePaths?.shadowHomePath).toContain(
` providers/ codex/${ instanceId}/ shadow` ,
NodePath.join(" providers", " codex", instanceId, " shadow") ,
);
const scan = yield* instance.snapshotForCwd!(serverConfig.stateDir).pipe(Effect.exit);
expect(Exit.isFailure(scan)).toBe(true);
Expand Down
Original file line number
Diff line number
Diff line change
Expand Up
@@ -293,7 +293,7 @@ describe("question answer paths", () => {
attachmentsDir: config.attachmentsDir,
attachmentsByQuestionId: { q: [file] },
});
expect(answers.q).toContain(`text extracted to: "${ path}.txt" `);
expect(answers.q).toContain(`text extracted to: ${JSON.stringify(`${ path}.txt`)} `);
expect(NodeFS.readFileSync(`${path}.txt`, "utf8")).toContain("Vessel: Larkspur");
expect(NodeFS.readFileSync(`${path}.txt`, "utf8")).toContain("301");
expect(NodeFS.readFileSync(`${path}.txt`, "utf8")).toContain("42");
Expand Down
Expand Up
@@ -354,7 +354,7 @@ describe("question answer paths", () => {
attachmentsDir: config.attachmentsDir,
attachmentsByQuestionId: { q: [file] },
});
expect(answers.q).toContain(path);
expect(answers.q).toContain(JSON.stringify( path) );
expect(answers.q).not.toContain("text extracted");
expect(NodeFS.existsSync(`${path}.txt`)).toBe(false);
expect(NodeFS.readFileSync(path, "utf8")).toBe("invalid document");
Expand Down
Expand Up
@@ -1146,7 +1146,7 @@ describe("question answer paths", () => {
expect(answers.q).toEqual([
"First",
"Second",
`Attached file "spec \\"final\\".txt": "${ path}" `,
`Attached file "spec \\"final\\".txt": ${JSON.stringify( path)} `,
]);
expect(answers.other).toBe("No file");
expect(original.q).toEqual(["First", "Second"]);
Expand All
@@ -1157,7 +1157,7 @@ describe("question answer paths", () => {
attachmentsByQuestionId: { ["__proto__"]: [attachment] },
});
expect(Object.keys(specialKey)).toEqual(["__proto__"]);
expect(specialKey["__proto__"]).toContain(path);
expect(specialKey["__proto__"]).toContain(JSON.stringify( path) );
}).pipe(Effect.provide(layer)),
);
it.effect("does not send an unavailable attachment path", () =>
Expand Down
Loading
Oops, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.