Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/server/src/environment/ServerEnvironment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ it.layer(NodeServices.layer)("ServerEnvironmentLive", (it) => {
it.effect("publishes proven install ownership only for manually updated servers", () =>
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const baseDir = yield* fs.makeTempDirectoryScoped();
const platform = yield* HostProcess.Platform;
const baseDir = yield* fs.realPath(yield* fs.makeTempDirectoryScoped());
const prefix = `${baseDir}/node`;
const entry = `${prefix}/lib/node_modules/t3/dist/bin.mjs`;
yield* fs.makeDirectory(`${prefix}/lib/node_modules/t3/dist`, { recursive: true });
Expand All @@ -103,11 +104,10 @@ it.layer(NodeServices.layer)("ServerEnvironmentLive", (it) => {
),
Effect.provideService(HostProcess.Arguments, ["node", entry]),
Effect.provideService(HostProcess.IsExecutable, false),
Effect.provideService(HostProcess.Platform, "linux"),
Effect.provideService(HostProcess.Environment, {}),
);
expect(descriptor.capabilities.serverInstallation).toEqual(
mode === "web" ? { kind: "npm-global", prefix } : undefined,
mode === "web" && platform !== "win32" ? { kind: "npm-global", prefix } : undefined,
);
expect(descriptor.capabilities.serverSelfUpdate).toBe(
mode === "web" ? undefined : "desktop-managed",
Expand Down
16 changes: 11 additions & 5 deletions apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1720,6 +1720,11 @@ describe("ClaudeAdapterV2 resume compaction", () => {
});

describe("ClaudeAdapterV2 attachments", () => {
const messageText = (content: SDKUserMessage["message"]["content"]) =>
typeof content === "string"
? content
: content.flatMap((block) => (block.type === "text" ? [block.text] : [])).join("\n");

it.effect.each([
...[
"retained-images",
Expand Down Expand Up @@ -1972,7 +1977,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(messageText(retried), documentPath);
assert.isBelow(Buffer.byteLength(JSON.stringify(offeredMessages)), 32_000_000);
return;
}
Expand Down Expand Up @@ -2021,7 +2026,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(messageText(sent), imagePath);
yield* runtime.steerTurn({
threadId,
runId: RunId.make("run-claude-attachments"),
Expand All @@ -2040,7 +2045,7 @@ describe("ClaudeAdapterV2 attachments", () => {
: steered.filter((block) => block.type === "image"),
0,
);
assert.include(JSON.stringify(steered), imagePath);
assert.include(messageText(steered), imagePath);
assert.isBelow(
Buffer.byteLength(
JSON.stringify(offeredMessages.map((message) => message.message)),
Expand Down Expand Up @@ -2102,7 +2107,7 @@ describe("ClaudeAdapterV2 attachments", () => {
0,
budget,
);
assert.include(JSON.stringify(sent), documentPath);
assert.include(messageText(sent), documentPath);
return;
}
if (!resumed) {
Expand Down Expand Up @@ -2315,7 +2320,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(messageText(sent), documentPath);
}
}).pipe(
Effect.provide(
Expand Down Expand Up @@ -4271,6 +4276,7 @@ describe("ClaudeAdapterV2 background wake turns", () => {
"true",
);
}).pipe(
Effect.provideService(HostProcess.Platform, "linux"),
Effect.provide(
Layer.mergeAll(IdAllocator.layer, McpProviderSessions.layer, NodeServices.layer),
),
Expand Down
Loading