From 0474c3e0aff0c6116d3d444dcf51e457b8036ba2 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Tue, 15 Sep 2026 04:45:17 +0200 Subject: [PATCH] fix(app): stop the streaming Markdown spec at a word boundary (#4875) The mock provider splits "**Bold" into two frames, "**Bo" and "ld". The helper forwarded both back-to-back and asserted the strong span reads "Bold", which only holds when the browser commits both frames to the store in one reducer flush and the message first mounts with "**Bold". When a frame boundary lands between the two tasks the message mounts with "**Bo" and word pacing holds "ld" until the whitespace after it arrives, so the span reads "Bo" until the gate releases. That is the designed behaviour of the reveal, and the batching is up to the browser's task scheduling. Stop after "**Bold text" instead: the space after "Bold" ends the word, so every batching reveals "Bold" and never more than "text". Forcing the frames into separate commits reproduced the CI failure before the change and passes after it. --- packages/app/e2e/support/helpers/streaming-markdown.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/app/e2e/support/helpers/streaming-markdown.ts b/packages/app/e2e/support/helpers/streaming-markdown.ts index 07d734f051..0c8107cf37 100644 --- a/packages/app/e2e/support/helpers/streaming-markdown.ts +++ b/packages/app/e2e/support/helpers/streaming-markdown.ts @@ -36,7 +36,11 @@ export async function requestStreamingMarkdown(agent: StreamingMarkdownAgent): P await agent.client.sendAgentMessage(agent.agentId, "Show the formatted streaming response."); // Exercise late assertions: the producer finishes before the browser consumes its frames. await agent.client.waitForFinish(agent.agentId, 30_000); - await agent.stream.showThrough("**Bold"); + // The mock splits "**Bold" into two frames. Whether they land in one store + // commit or two is up to the browser's task scheduling, and word pacing only + // releases a word once the whitespace after it has arrived, so stop after + // that whitespace: every batching then reveals "Bold" and nothing past "text". + await agent.stream.showThrough("**Bold text"); } export async function expectUnfinishedBold(page: Page): Promise {