Skip to content

ci-fix: nightly ci failing — a press is swallowed when a state read reconciles under it #226

Closed

Description

@leaf-agent

Failure

The nightly leg of ci on main, two runs in a row, on two different cases with one shape — a press that produces no send:

  • run 33662045196 (b9cfe18): tests/test_render_drafts.py::test_a_comment_hidden_by_narrowing_is_revealed_in_the_open_panel[False] — the page never held the filtered comment send: the wait began on sends=0 acked=0 pending=0 asked=1 heard=1 and gave up on sends=0 acked=0 pending=0 asked=1 heard=1
  • run 33669852274 (12dd428): tests/test_render_reactions.py::test_spilled_reactions_keep_their_target_and_yield_to_the_map[click-390] — the page never sent the spilled reaction: with the same counters at both ends.

Both wait out the full 30s with the counters unmoved, so nothing was posted and nothing was refused: the gesture never became a send.

Diagnosis

Reproduced here about once in thirty runs of the drafts case with eight CPU burners running beside it, never without load. The instrumented run reads the page either side of the Enter press:

before {'active': 'TEXTAREA.lf-ui lf-response-control lf-fab-input', 'barShown': True,
        'value': 'This comment starts outside the filter.', 'composerOpen': True}
after  {'active': 'TEXTAREA.',                                      'barShown': False,
        'value': '',                                                'composerOpen': True}

So the response bar was withdrawn between the fill and the press, its field emptied, and focus handed to another textarea; the Enter then landed in that box, where a plain Enter is a newline. refreshFab is the withdrawal — if (!placeFab()) showFab(null, null, { returnFocus: "page" }) in runtime/composing/surface.js — reached from syncFloats in syncLayout, which the panel's own reconcile runs.

The counters name the trigger: asked=1 heard=1 before the wait even began, so a state read had landed around the fill. Waiting alone does not withdraw the bar — held for 100ms, 400ms, 1.5s and 4s after the same fill, it stands with focus and words intact every time — so this is not the geometry at rest refusing the bar. It is a placement measured while an arriving read is still reconciling the panel.

The reactions case is the same shape one surface over: the Page-map sheet forwards its press to the real control on the next frame (the test's own comment says so), and the temporary reaction palette that press is aimed at is rebuilt by the margin's render, which every complete state application dispatches through lf-actions.

The reader's version of this is worse than the suite's: a poll arriving while they type takes their composer away mid-sentence.

Why no fix was produced

Withdrawing a bar that cannot be placed is a stated contract, not an oversight — skills/leaf/CLAUDE.md: "When a covering panel leaves no usable band for the response bar, placement withdraws it without discarding its draft. If the disappearing bar held focus, the visible Threads list takes it." The fix is therefore about when the measurement is taken, not whether the withdrawal is right, and it lands on either syncFloats' place in syncLayout or on placeFab's reading of a shell mid-reconcile. Both are load-bearing for the panel's own easing, and at one reproduction in thirty runs a change there cannot be validated from here — a green loop proves nothing about a race that only shows under a loaded machine.

It is the class .claude/skills/running-tend/SKILL.md already names under Reading a red suite — a press that ran before the page said it was ready — with the fix owned by the ordering rather than by a retry.

Activity

  1. leaf-agent commented on Sep 2, 2026

    @leaf-agent
    CollaboratorAuthor

    Reproduced the drafts case here — about 1 run in 12 with eight CPU burners beside it on this four-core runner — and the diagnosis above turns out not to hold. placeFab never returns false in a failing run, and the bar is still being placed while the withdrawal happens: it comes from settleAcceptedDrafts closing a composer whose draft the server had genuinely accepted. The page did everything right. The Enter posted the comment, the log took it at seq=3, and the POST's own answer settled the draft and closed the composer.

    What never happened is Playwright seeing that POST. Neither the route the test installs a keystroke earlier nor page.on("request") reported it, so Traffic.sends stayed at nought and the wait timed out on counters that were never going to move. Chromium arms request interception the first time a page is routed at all, and Playwright's acknowledgement of page.route outruns that arming — a request issued in the milliseconds after the call goes straight to the server. It is the escape held_events was already written around, and tests/CLAUDE.md already names it; the standing guidance was to route from navigation onward, which twenty-nine live page.route("**/api/event", …) sites do not.

    #231 arms every page open_page makes on a pattern nothing ever asks for, so a route registered later only adds to a list the browser is already consulting. That closes the trap at all twenty-nine sites rather than at this one test.

    The reactions failure is a different defect and #227 already has it — a <dialog> close landing after its own reopen. The two share a shape and nothing else. This issue can close when both land.

    Evidence

    Instrumented placeFab, showFab, settleAcceptedDrafts and postEvent in a reproducing run. The withdrawal's stack:

    at showFab            (runtime/composing/surface.js:267)
    at closeComposer      (runtime/composing/selection.js:291)
    at watchDraft update  (runtime/drafts.js:262)
    at tellDraft          (runtime/drafts.js:44)
    at settleAcceptedDrafts (runtime/drafts.js:217)
    at apply              (runtime/state-application.js:208)
    at Object.receiveState (runtime/state-application.js:307)
    

    runtime.browser.receipts at that moment held the comment itself, with the live draft's own attempt:

    {"kind":"comment","text":"This comment starts outside the filter.",
     "attempt":"e18db50383fd1463750f5b12b6fc53e0","seq":3, …}
    

    performance.getEntriesByType("resource") inside the page shows the POST completing (transferSize 5699, 27ms) with sends=0 on the Python side throughout, and the stack of the send is drainOutbox → deliver → postEvent. In passing runs the route handler fires; in failing runs it never does.

    Arms, each under the same eight burners:

    arm route registered runs failures
    A a keystroke before the press (today) 80 4
    B before the panel opens 40 0
    C late, but interception pre-armed (#231) 40 0

    With the fix the named case ran 40 more times under that load with no failure. tests/test_render_drafts.py is 61 passed and the everyday suite 805 passed, 6 skipped; the file costs 43.8s without the change and 44.7s with it.

  2. leaf-agent commented on Sep 3, 2026

    @leaf-agent
    CollaboratorAuthor

    Both fixes this issue named as its closing condition have landed: #231 (d02b101e, arms request interception when a test page is made) and #227 (4d130e36, keeps the page map's target through a close that lands after its reopen).

    Neither named case has failed since. The four complete nightly legs on main after those merges — 33698883459 (4c737cd), 33702158485 (c370784), 33714432132 (bf9dd47), 33718675826 (e0a0549) — contain no failure of test_a_comment_hidden_by_narrowing_is_revealed_in_the_open_panel or test_spilled_reactions_keep_their_target_and_yield_to_the_map.

    Closing on that. main's nightly is still red, but on a disjoint set that belongs to later commits and is already carried by #236 (the six #232/#233 fixture and product cases, deterministic across all four runs) and #239 (three of bf9dd47's own six) — not by anything this issue diagnosed.

    Failing cases per run since the merges
    case 4c737cd c370784 bf9dd47 e0a0549 owner
    test_a_widgets_label_takes_a_comment_inside_the_control_it_labels ✗ ✗ ✗ ✗ #236
    test_a_closed_leaf_clears_itself_off_the_tray ✗ ✗ ✗ ✗ #236
    test_every_ring_the_layer_draws_is_shown_whole_somewhere_in_the_corpus ✗ ✗ ✗ ✗ #236
    test_the_leaves_tray_takes_the_keyboard ✗ ✗ ✗ ✗ #236
    test_the_g_chord_reaches_panels_and_document_lists ✗ ✗ ✗ ✗ #236
    test_escape_lets_go_of_the_ask_the_reader_is_standing_on ✗ ✗ ✗ ✗ #236
    test_the_label_is_chrome_rather_than_words_to_quote@site ✗ ✗ — — fixed on main by 991c64c
    test_every_passage_in_a_real_page_can_be_quoted[feature-gallery] — — ✗ ✗ #239
    test_ask_addresses_follow_the_feature_gallery_s_visible_margin_controls[1200], [390] — — ✗ ✗ #239
    test_the_shipped_long_thread_opens_beside_its_source_in_the_right_margin — — ✗ ✗ #239
    test_a_pick_states_the_whole_set — — ✗ — #239 reports, does not fix
    test_selected_reactions_keep_neutral_button_furniture[dark] — — ✗ — #239 reports, does not fix
    test_a_comment_on_a_wrapped_diff_line_names_the_line_an_unwrapped_one_names — — ✗ — #239 reports, does not fix

    Read from gh run view <id> --log-failed on each run.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions