diff --git a/web/test/ui-smoke.mjs b/web/test/ui-smoke.mjs index fbf4ca72..f63d79c8 100644 --- a/web/test/ui-smoke.mjs +++ b/web/test/ui-smoke.mjs @@ -2448,6 +2448,14 @@ try { if (openedId !== expectedSession) { console.log(` -- the live server's first session with history is ${openedId}, not ${expectedSession}`); } + // Leave the discovered session first: the loop above already opened it, and + // openChatSession keeps a loaded thread, so clicking it again would early-return + // and send nothing. Opening a different row restores a genuine fresh open. + const otherRow = candidates.find((id) => id !== openedId); + if (otherRow) { + await page.click(`#chatRows .chat-row[data-session="${otherRow}"]`); + await new Promise((resolve) => setTimeout(resolve, 600)); + } // Record the frames the page sends, so the C11 chat_shells fetch on open is // asserted rather than assumed. await page.evaluate(`(() => { window.__pipelinesSentTypes = []; return true; })()`);