From c97eccb7a890d9bbb0298cc46b30d0bcbe56bbb1 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 11:39:48 +0000 Subject: [PATCH] Align smoke parser response id bounds with websocket contracts Co-authored-by: Theo Browne --- apps/t3/scripts/smoke-test.mjs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/t3/scripts/smoke-test.mjs b/apps/t3/scripts/smoke-test.mjs index 02adbd2eed..fb8dcec4b8 100644 --- a/apps/t3/scripts/smoke-test.mjs +++ b/apps/t3/scripts/smoke-test.mjs @@ -19,6 +19,8 @@ const WS_EVENT_CHANNELS = { agentOutput: "agent:output", agentExit: "agent:exit", }; +const WS_REQUEST_ID_MAX_CHARS = 256; +const WS_METHOD_MAX_CHARS = 256; function isRecord(value) { return typeof value === "object" && value !== null; @@ -76,7 +78,12 @@ function parseWsMessage(raw) { return null; } - if (typeof parsed.id !== "string" || typeof parsed.ok !== "boolean") { + if ( + typeof parsed.id !== "string" || + parsed.id.length === 0 || + parsed.id.length > WS_REQUEST_ID_MAX_CHARS || + typeof parsed.ok !== "boolean" + ) { return null; } @@ -2143,7 +2150,7 @@ async function main() { ws.send( JSON.stringify({ type: "request", - id: "x".repeat(300), + id: "x".repeat(WS_REQUEST_ID_MAX_CHARS + 1), method: "app.health", }), ); @@ -2151,7 +2158,7 @@ async function main() { JSON.stringify({ type: "request", id: "smoke-malformed-long-method", - method: "m".repeat(300), + method: "m".repeat(WS_METHOD_MAX_CHARS + 1), }), ); const postMalformedHealthResponse = await sendWsRequest(ws, {