Skip to content

test: wait for the card's stream growth to settle before judging Send - #6610

Merged
max-sixty merged 1 commit into
mainfrom
fix/issue-6602
Nov 20, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/issue-6602

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

test_sending_during_a_stream_keeps_later_tokens_from_moving_the_reply[pending] read its baseline before Send while the waiting answer's growth was still moving. Leaf didn't move the card at Send. The test now waits for the card at rest (CARD_AT_REST) before that reading, as it already does after Send. Leaf's behavior doesn't change, and the test protects the same promise from a settled reading.

Cause. On CI's Mac, the answer's arrival motion sometimes overflows the transcript partway through. The scrollbar that the test makes take room then appears, the answer rewraps from three lines to four in the narrower transcript, and the card rises to 125 px. When the motion ends, the overflow and the bar go, and the card settles back at 146 px. The test read before_send inside that window, so the post-Send check compared a settled card at 146 with a transient 125: the assert 146.14 == 125.14 in #6602. On Linux the answer overflows the transcript even at rest, so both readings agree there and the test passes.

Evidence. I traced the card frame by frame on CI's Mac in diagnostic dispatches of the test alone (--workers 1 --load 4) on main plus instrumentation:

  • 44772177206 failed 2 of 18 and 44774023648 failed 7 of 36. Every failure had the same shape. In passing copies the transcript fits at 231 px with no bar, and the card stands at 146 both before and after Send.
  • In failing copies, the frame after the answer's text lands shows content 286 px in a 252 px transcript while a .lf-msg style mutation is in progress. Over the next frames the content shrinks (286 → 276 → 268 → 261) as the motion runs out, and the bar shows throughout with the answer at four lines. Once the content reaches 252, the bar drops, the answer returns to three lines and the card stands at 146. All of this happens before the Send click.

With the change, dispatch 44776968020 on CI's Mac passed 54 of 54 copies at this head. At the 7-in-36 rate measured on main, about ten of them would have failed.

Left open. The motion's transient overflow also flashes the bar for real users on hosts whose scrollbars take room. When the answer sits at a wrap boundary, that lifts the card a line and drops it back. The reply row the user is typing in stays still (the test's reply assertion held in every failing copy). #6611 tracks that, since it is about the transcript's overflow during an arrival rather than this test's read.

Closes #6602 — automated triage

test_sending_during_a_stream_keeps_later_tokens_from_moving_the_reply read
its baseline before Send while the waiting answer's growth was still moving.
On CI's Mac, mid-motion the turns overflowed the transcript, the bar that
takes room rewrapped the answer a line taller, and the card stood 21 px higher
(125 against 146) until the motion ended and the bar went. The assertion after
Send then compared the settled card to that transient reading. The test now
waits for the card at rest before its baseline. Leaf's behavior doesn't change;
the test protects the same promise from a settled reading.

Closes #6602
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test_sending_during_a_stream_keeps_later_tokens_from_moving_the_reply[pending]: the card's reply moves 21 px as the waiting answer streams in on macOS

2 participants