Skip to content

Let a key leave a thread card's end while the card is being placed - #5384

Merged
max-sixty merged 2 commits into
mainfrom
fix-core-tests-main
Nov 4, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix-core-tests-main

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

uv run pytest tests passes on CI at every recent merge, but two of its tests failed on main in a local run on a busy Mac. leaf-dev flake (18 concurrent copies) reproduced both and shows both gone with this change.

test_reading_keys_follow_a_submitted_comment_s_viewport, 9 of 18 copies failed, now 0 of 18. A user can hit this one. Pressing u or k with a thread card's transcript at its end starts a glide whose first frame can write where the box already stands, because that frame's timestamp can precede the press. A card placement in the same frame read the transcript as still at its end, called scrollToEnd, and stopped the glide, so the key did nothing. An instrumented run showed the sequence: keydown, a glide tick writing the same offset, measureThreadCard's scrollToEnd, then no further tick.

followsEnd (scrolling.js) now answers whether a box stands at its end with no glide taking it away. The card's placement, its reading of an arriving turn and the thread card's news check all ask it. A glide heading down to the end still reads as not following until it arrives, as before.

test_a_call_ends_before_codex_gives_up_on_it, 3 of 18 copies failed, now 0 of 18. The test read the pid the stand-in launcher writes, and under load the server's 0.5 s deadline can end the launcher before it writes one. The test now checks the exit status, -15, which shows the deadline's SIGTERM ended the command. What it protects is unchanged: a call ends at the deadline and says so.

The other routes off a card's end (k, PageUp, ArrowUp, the wheel) each passed 18 of 18 copies on this tree. The broad selection passes locally with 8 workers, and the 31 browser tests that read a margin card's transcript pass by node id.

This was written by Claude Code on behalf of max-sixty

Pressing `u` or `k` with a card's transcript at its end starts a glide whose
first frame can write where the box already stands. A card placement in that
frame read the transcript as still at its end, called `scrollToEnd`, and stopped
the glide, so the key did nothing. `followsEnd` answers whether a box stands at
its end with no glide taking it away, and the card's placement, its reading of
an arriving turn and the thread card's news check all ask it.

test_a_call_ends_before_codex_gives_up_on_it now checks the exit status rather
than the pid the stand-in launcher writes, since the 0.5 s deadline can end the
launcher under load before it writes one.
@max-sixty
max-sixty merged commit 3993b3a into main Nov 4, 2026
4 checks passed
@max-sixty
max-sixty deleted the fix-core-tests-main branch November 4, 2026 18:56
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.

2 participants