Skip to content

Reveal a posted thread whose card the reload drew first (review_rounds flake) - #6

Merged
kylekz merged 1 commit into
mainfrom
claude/review-rounds-flake
Nov 9, 2026
Merged

kylekz merged 1 commit into
mainfrom
claude/review-rounds-flake

Conversation

@kylekz

@kylekz kylekz commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Fixes the Windows CI flake at tests/e2e/review_rounds.jsonl:85 (/stream/top_file read src/lib/http.ts, not src/lib/cache.ts). It's a real app bug, not a scenario timing problem.

Cause

Posting a comment sets the diff pane's pending_thread, and the next change to the rows that draws the card reveals it. Two things race after the write lands: the review's reload, and the post's answer reaching the pane. On a loaded machine the reload can draw the card first. posted() then refreshes rows that no longer change, so nothing reveals or clears the pending thread. It stays pending until some later listing draws that card again, and then the stream scrolls to it.

In review_rounds, that was the last round-1 comment (on users.ts). When round 2's interdiff was listed, the stream scrolled just far enough to bring that card into view, which put http.ts at the top. For a reviewer, the same bug means the stream can later jump back to a comment they posted earlier.

Fix

posted() reveals the card at once when it's already drawn (crates/dv_ui/src/diff_pane/threads.rs).

Evidence

  • A new pane test, a_post_answered_after_its_card_is_drawn_leaves_nothing_to_reveal_later, replays the late answer. It fails on main (the stream jumps from c.txt back to b.txt on the next rows change) and passes with the fix.
  • Stress on windows-2025, review_rounds run four at a time, 24 runs per variant: main failed 15/24 and then 9/24 at line 85; with the fix, 24/24 passed.
  • A first theory, that the agent's three writes landing between watcher refreshes put http.ts first, was tested and ruled out: reordering the writes still failed 13/24.
  • script/check passes on macOS (every step, 34 e2e scenarios).

🤖 Generated with Claude Code

Posting a comment sets the pane's pending thread and reveals its card
once a change to the rows draws it. The review's reload and the post's
answer race: on a loaded machine the reload can draw the card first, so
posted() refreshed rows that no longer changed and nothing revealed or
cleared the pending thread. It stayed pending until a later listing drew
its card again and scrolled the stream to it, e.g. round 2's interdiff in
review_rounds, which then opened on http.ts instead of cache.ts (the
Windows CI flake at review_rounds.jsonl:85).

posted() now reveals the card at once when it is already drawn.

Under load on windows-2025 (review_rounds four at a time, 24 runs):
main fails 9 to 15 of 24 at that assertion; with this 24 of 24 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kylekz
kylekz marked this pull request as ready for review November 9, 2026 13:09
@kylekz
kylekz merged commit 8a2e434 into main Nov 9, 2026
2 of 5 checks passed
@kylekz
kylekz deleted the claude/review-rounds-flake branch November 9, 2026 13:10
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.

1 participant