The agent-view spec's "carries its reveal across settling" test leaves 2 to 18 characters to carry, and fails under load #135
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ui/e2e/agent-view.spec.ts, "a streaming answer › carries its reveal across settling when the part settles mid-reveal" (@slow, about line 202), depends on timing it does not control.Seen (2026-10-03)
./tools/test.sh full, Playwright at 4 workers) with "the reveal had already finished; nothing was carried": 1,167 of 1,167 characters were visible at the hand-over from the live answer to the settled one.npx playwright test e2e/agent-view.spec.ts:202 --repeat-each=8 --workers=1), and the #130 session never saw it fail.POST /_fake/scenario?settle=0.02, the spec's sampling) measured the characters still unrevealed at the hand-over. Over 16 runs it was between 2 and 18, and the longest frame was 17 to 19 ms. Builds with and without the #133 list fix had the same margins.Why the margin is so small
The fixture answer (
ANSWER_TEXTinui/dev/fakeosfd.py) is 1,299 characters, streamed in bursts of 80 every 250 ms, so its last burst carries only 19 (1,299 mod 80). Withsettle=0.02, the settled event goes out on the other stream 20 ms after that burst. A frame of about 30 ms or more, or a settled event held up by CPU load, lets the reveal finish first, and the test fails.It is also weaker than it reads. With at most 18 characters left, the second assertion (what was left still arrived at most 24 characters a frame) cannot fail, because the whole remainder fits in one frame's allowance.
Wanted
The hand-over lands mid-reveal by construction, not by a few characters, and the test keeps its assertions: the reveal is carried across settling, at most 24 characters a frame. Directions, not decided: settle the part before its last burst arrives (
ui/src/lib/reveal.tsalready handles a part that settles before its last burst), or make the scenario's last burst large. ChangingANSWER_TEXTis risky, because other specs depend on it.Verify under load the way #130 did: seven busy loops and
--repeat-each=16 --workers=1, before and after..arrives, and the agent-view spec fails under load #130Shipped in
0059708and archived inba2d22a. Both commits are[skip ci]: the change is test-only, so there was nothing to deploy.What changed
settle=-0.375. The answer settles 375 ms before its last burst, so its last two bursts (99 characters) are never streamed. The settled answer always holds text the live one never had, so the hand-over is mid-reveal by construction. The fixture already behaved this way for a negativesettle; only its comment inui/dev/fakeosfd.pychanged.test-lanesspec has a new requirement: "The agent-view spec's hand-over is mid-reveal by construction".Measured
Characters still to reveal at the hand-over, from a probe of the spec's own sampling:
settleopencode serve; all 4 pass alone.