diff --git a/scripts/src/hwlab-node-web-observe-runner-source.ts b/scripts/src/hwlab-node-web-observe-runner-source.ts index 7b00d626..d2ea11b0 100644 --- a/scripts/src/hwlab-node-web-observe-runner-source.ts +++ b/scripts/src/hwlab-node-web-observe-runner-source.ts @@ -363,7 +363,12 @@ async function sendPrompt(text) { await submit.waitFor({ state: "visible", timeout: 15000 }); const chatResponsePromise = page.waitForResponse((response) => { const request = response.request(); - return request.method().toUpperCase() === "POST" && response.url().includes("/v1/agent/chat"); + if (request.method().toUpperCase() !== "POST") return false; + try { + return new URL(response.url()).pathname === "/v1/agent/chat"; + } catch { + return false; + } }, { timeout: 20000 }).catch((error) => ({ waitError: errorSummary(error) })); await submit.click(); const chatResponse = await chatResponsePromise;