From 3ac9d765099e4fc8e930c2158779747c5423393e Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 01:35:01 +0000 Subject: [PATCH] Cover relative missing terminal cwd error details Co-authored-by: Theo Browne --- apps/t3/src/runtimeApiServer.test.ts | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/apps/t3/src/runtimeApiServer.test.ts b/apps/t3/src/runtimeApiServer.test.ts index a00ef15666..baf5f1f0b0 100644 --- a/apps/t3/src/runtimeApiServer.test.ts +++ b/apps/t3/src/runtimeApiServer.test.ts @@ -1611,6 +1611,37 @@ describe("runtimeApiServer", () => { client.socket.close(); }); + it("returns launch-cwd-relative errors when terminal cwd is missing", async () => { + const launchCwd = mkdtempSync(path.join(os.tmpdir(), "t3-terminal-missing-relative-")); + const server = await startRuntimeApiServer({ + port: 0, + launchCwd, + }); + servers.push(server); + + const client = await connectClient(server.wsUrl); + await client.nextMessage(); + + const response = await sendRequest( + client.socket, + client.nextMessage, + "terminal-missing-relative-1", + "terminal.run", + { + command: "pwd", + cwd: "missing-subdir", + }, + ); + expect(response.ok).toBe(false); + if (response.ok) { + throw new Error("Expected relative missing terminal cwd response to fail."); + } + expect(response.error?.code).toBe("request_failed"); + expect(response.error?.message).toContain(path.join(launchCwd, "missing-subdir")); + + client.socket.close(); + }); + it("returns structured errors when terminal cwd is not a directory", async () => { const server = await startRuntimeApiServer({ port: 0,