From bf2d01729f779675605277e3c03d5aeb36c80b85 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 01:03:32 +0000 Subject: [PATCH] Cover relative cwd resolution in terminal integration tests Co-authored-by: Theo Browne --- apps/t3/src/runtimeApiServer.test.ts | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/apps/t3/src/runtimeApiServer.test.ts b/apps/t3/src/runtimeApiServer.test.ts index 08487c661c..5d858e12d8 100644 --- a/apps/t3/src/runtimeApiServer.test.ts +++ b/apps/t3/src/runtimeApiServer.test.ts @@ -1311,6 +1311,39 @@ describe("runtimeApiServer", () => { client.socket.close(); }); + it("resolves relative terminal cwd paths against runtime working directory", async () => { + const server = await startRuntimeApiServer({ + port: 0, + launchCwd: process.cwd(), + }); + servers.push(server); + + const client = await connectClient(server.wsUrl); + await client.nextMessage(); + + const response = await sendRequest( + client.socket, + client.nextMessage, + "terminal-cwd-relative-1", + "terminal.run", + { + command: "pwd", + cwd: ".", + }, + ); + expect(response.ok).toBe(true); + if (!response.ok) { + throw new Error("Expected relative terminal cwd response to succeed."); + } + + const payload = response.result as { + stdout: string; + }; + expect(payload.stdout.trim()).toBe(process.cwd()); + + client.socket.close(); + }); + it("returns structured errors when terminal cwd does not exist", async () => { const server = await startRuntimeApiServer({ port: 0,