What happened
The Desktop E2E test history asked for at the very top of the scroller still lands above the reader in apps/desktop/e2e/transcript-scroll.spec.ts can time out under concurrent CI load. The failure was observed in PR #4417, but the flake is independent of that PR and should be fixed separately.
In the failing sample, immediately before the test assigned root.scrollTop = 0, the scroller already reported:
{ "scrollTop": 0, "scrollHeight": 3246, "clientHeight": 780 }
The 0 -> 0 assignment is a no-op, so Chromium emits no reader scroll event. useChatScroll therefore does not call requestEarlier / loadEarlier, and the first resident turn remains turn-prompt-rail-111 until the 20-second assertion timeout. The initial transcript tail pin completes only afterward.
Expected behavior: the test must wait until initial tail positioning has settled before it performs the real move to the top and asserts that earlier history loads.
How to reproduce
From apps/desktop, after building the Desktop E2E app:
npx playwright test --config e2e/playwright.config.ts e2e/transcript-scroll.spec.ts --grep "history asked for at the very top" --workers=4 --repeat-each=12
The failure is timing-dependent. Investigation results:
- Single-worker isolated rerun: 5/5 passed.
- Four workers with 12 repeats: reproduced twice.
- Four workers with 16 repeats and temporary read-only diagnostics: reproduced once.
Environment
Logs, screenshots, or additional context
Root cause: the prompt-rail fixture waits for transcript DOM presence, not for initial tail positioning to settle. Under load, the test can overtake that positioning. A deterministic test-only fix should wait for one geometry sample with scrollTop > 0 and distance-to-tail <= 4, then set scrollTop = 0. A fixed delay or a larger history assertion timeout would not address the race.
Created with OpenAI Codex assistance.
What happened
The Desktop E2E test
history asked for at the very top of the scroller still lands above the readerinapps/desktop/e2e/transcript-scroll.spec.tscan time out under concurrent CI load. The failure was observed in PR #4417, but the flake is independent of that PR and should be fixed separately.In the failing sample, immediately before the test assigned
root.scrollTop = 0, the scroller already reported:{ "scrollTop": 0, "scrollHeight": 3246, "clientHeight": 780 }The
0 -> 0assignment is a no-op, so Chromium emits no reader scroll event.useChatScrolltherefore does not callrequestEarlier/loadEarlier, and the first resident turn remainsturn-prompt-rail-111until the 20-second assertion timeout. The initial transcript tail pin completes only afterward.Expected behavior: the test must wait until initial tail positioning has settled before it performs the real move to the top and asserts that earlier history loads.
How to reproduce
From
apps/desktop, after building the Desktop E2E app:The failure is timing-dependent. Investigation results:
Environment
Logs, screenshots, or additional context
Root cause: the prompt-rail fixture waits for transcript DOM presence, not for initial tail positioning to settle. Under load, the test can overtake that positioning. A deterministic test-only fix should wait for one geometry sample with
scrollTop > 0and distance-to-tail<= 4, then setscrollTop = 0. A fixed delay or a larger history assertion timeout would not address the race.Created with OpenAI Codex assistance.