test(pty): deflake agent_focus auto-review receipt test - #5457
Merged
Conversation
…hows_in_focus — Left+200ms+Enter raced with worker completion dropping rail focus
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
Contributor
|
Claude finished @Hmbown's task in 1m 53s —— View job Reviewing PR #5457
ReviewTest-only change ( Correctness
Reuse / duplication
Tests
Provider/model/route safetyNot applicable — no model/provider selection logic in this diff. SummarySolid, well-reasoned flake fix with a clear root-cause explanation matching the code changes. Only minor, non-blocking suggestions above (row-scoped "completed" check if reused, and clarifying which wait actually prevents the race). |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
macOS CI flake in
agent_focus_pty::auto_review_gates_a_workers_call_and_the_receipt_shows_in_focus. The nextest FAIL block is:Seen on jobs 95242220506 (PR #5448), 95242912374 (PR #5438 run 31979001550), and reported on 95245484898 (PR #5445). Same dump on independent PRs (including docs-only); reruns pass.
Root cause
The sibling
focus_a_worker_send_a_follow_up_and_return_to_mainkeeps workersrunning(40s mock hold) and does not flake. This test let the child's wrap-up return immediately, then slept 200ms between←and Enter.By the time those keys were sent the worker was already
completed. Top placement collapses settled workers off the live strip (project_visible/agent_row_is_strip_settled).←can still switch the rail to the Agents panel, but the 200ms gap is a window for completion redraws /clamp_viewport/collapse_stripto drop rail keyboard focus. Enter then hits the empty composer (no-op). After the CI-scaled 5s wait the dump is still the main conversation with← for agentsadvertised.wait_for_text("for agents")is also true from the moment the worker exists, so it does not mean the parent turn or the rail have settled.This is a test race, not a product bug in Auto-Review. Focusing a completed worker via the Agents register remains a supported path (
finished_agent_row_opens_its_transcript_and_alt_v_reaches_details); this journey just needs a live row, the same way the sibling does.Fix
runningwhile we focus.✓ done, empty composer,gate-workerwithoutcompleted) instead of a fixed sleep.←+Enter back-to-back so Enter lands on the Agents panel.Auto-Review allowed 'bash'andmodel guardian) on the focused frame.Testing
cargo fmt --all -- --checkcargo clippy -p codewhale-tui --test pty -- -D warningscargo clippy --workspace --all-targets --all-features --lockedcargo test --workspace --all-features --lockedVerification
Not verified: macOS GitHub Actions under full-workspace nextest load; workspace clippy/test gate.
Refs #5056 #5403
No-Issue: CI flake fix tracked under #5056