diff --git a/apps/server/src/environment/ServerEnvironment.test.ts b/apps/server/src/environment/ServerEnvironment.test.ts index 7cebccb2a1f7c..4d631dbc61889 100644 --- a/apps/server/src/environment/ServerEnvironment.test.ts +++ b/apps/server/src/environment/ServerEnvironment.test.ts @@ -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 }); @@ -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", diff --git a/apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts b/apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts index 8494c4cab7812..555849d91ff8b 100644 --- a/apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts +++ b/apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts @@ -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", @@ -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; } @@ -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"), @@ -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)), @@ -2102,7 +2107,7 @@ describe("ClaudeAdapterV2 attachments", () => { 0, budget, ); - assert.include(JSON.stringify(sent), documentPath); + assert.include(messageText(sent), documentPath); return; } if (!resumed) { @@ -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( @@ -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), ),