Cover invalid terminal.run payload errors

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-09 23:34:47 +00:00
1 parent 0e1f3844bf
commit c06af1b25e
1 file changed
+28
+28
View File
@@ -593,6 +593,34 @@ describe("runtimeApiServer", () => {
client.socket.close();
});
it("returns structured errors for invalid terminal.run 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,
"terminal-invalid-1",
"terminal.run",
{
command: "",
},
);
expect(response.ok).toBe(false);
if (response.ok) {
throw new Error("Expected invalid terminal 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,