From 0e1f3844bf82a4112c7ef9ae3cb7e5f10d99ba09 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 9 Feb 2026 23:34:12 +0000 Subject: [PATCH] Cover invalid shell.openInEditor payload errors Co-authored-by: Theo Browne --- apps/t3/src/runtimeApiServer.test.ts | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/apps/t3/src/runtimeApiServer.test.ts b/apps/t3/src/runtimeApiServer.test.ts index 0466820fc3..a40059b975 100644 --- a/apps/t3/src/runtimeApiServer.test.ts +++ b/apps/t3/src/runtimeApiServer.test.ts @@ -564,6 +564,35 @@ describe("runtimeApiServer", () => { client.socket.close(); }); + it("returns structured errors for invalid shell.openInEditor payloads", 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, + "shell-invalid-1", + "shell.openInEditor", + { + cwd: "/workspace", + editor: "unknown-editor", + }, + ); + expect(response.ok).toBe(false); + if (response.ok) { + throw new Error("Expected invalid shell payload to fail."); + } + expect(response.error?.code).toBe("request_failed"); + + client.socket.close(); + }); + it("reports runtime health metadata", async () => { const server = await startRuntimeApiServer({ port: 0,