From 516b86c825ad826800abbb31a6445e03a1bd6dd0 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 01:34:27 +0000 Subject: [PATCH] Cover relative missing shell target 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 b928ed43af..a00ef15666 100644 --- a/apps/t3/src/runtimeApiServer.test.ts +++ b/apps/t3/src/runtimeApiServer.test.ts @@ -1036,6 +1036,37 @@ describe("runtimeApiServer", () => { client.socket.close(); }); + it("returns launch-cwd-relative errors for missing shell.openInEditor targets", async () => { + const launchCwd = mkdtempSync(path.join(os.tmpdir(), "t3-shell-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, + "shell-missing-relative-1", + "shell.openInEditor", + { + cwd: "missing-dir", + editor: "file-manager", + }, + ); + expect(response.ok).toBe(false); + if (response.ok) { + throw new Error("Expected relative missing shell target request to fail."); + } + expect(response.error?.code).toBe("request_failed"); + expect(response.error?.message).toContain(path.join(launchCwd, "missing-dir")); + + client.socket.close(); + }); + it("returns structured errors when shell.openInEditor target is not a directory", async () => { const server = await startRuntimeApiServer({ port: 0,