From 27a16051274729e4a9210c50f0baed74082f09e8 Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Mon, 19 Oct 2026 07:36:47 +0100 Subject: [PATCH] =?UTF-8?q?web:=20ui-smoke=20=E2=80=94=20C5=20after=20the?= =?UTF-8?q?=20composer=20section=20re-opens=20the=20chat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The merge put main's C5 live-stream section after the C8/C9 composer section, but the composer section closes its throwaway session and returns to the list, so no conversation was open for C5 to observe. The C5 section now re-opens the operator's own session (read-only: real subscribe + history, synthetic frames injected into the page's socket handler) and waits for its newest history page to render before replaying, so the history load cannot replace the replayed turn. `node test/ui-smoke.mjs` is green end to end against ws://127.0.0.1:8080/connect. --- web/test/ui-smoke.mjs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/web/test/ui-smoke.mjs b/web/test/ui-smoke.mjs index f0700e26..f861994b 100644 --- a/web/test/ui-smoke.mjs +++ b/web/test/ui-smoke.mjs @@ -3152,6 +3152,21 @@ try { // frames replayed below are synthetic, and this log says so explicitly. step("C5: the live stream — subscribe, replayed chat_event frames, stream state"); await ensureConnected(); + // The composer section above closes its throwaway session and returns to the + // list, so no conversation is open here. Re-open the operator's own session to + // observe its live stream — read-only: the `chat_subscribe` and every history + // fetch are real, and the frames below are injected into the page's own socket + // handler rather than sent to the server. + const chatOpen = await page.evaluate(`!!document.querySelector("#chatInput")`); + if (!chatOpen) { + await page.waitForSelector(`#chatRows .chat-row[data-session="${openedId}"]`, { timeout: 15000 }); + await page.click(`#chatRows .chat-row[data-session="${openedId}"]`); + await page.waitForSelector("#chatInput", { timeout: 15000 }); + // The newest history page arrives asynchronously and its render replaces the + // held messages, so wait for it to land (`#chatTranscript` is rendered only + // once the thread is loaded) before replaying frames into the page. + await page.waitForSelector("#chatTranscript", { timeout: 20000 }); + } await page.evaluate(`document.querySelector("#chatJump")?.click()`); const chatBadge = () =>