Repository navigation
fix(desktop): refuse a swipe or fill the driver cannot confirm, and retry stalled reads (ENG-1533) - #2353
Conversation
michal-e2e
left a comment
There was a problem hiding this comment.
Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.
Reviewed at b19515d66 (merge base 026d8570d, main), the bottom of stack 2359.
Nothing blocks this one, @kdy1. All eight items left open on #2322 are answered in the driver, and the checks below are green. The optional items are everything I found, so nothing new should come up in a later round on this commit. The first one is a behavior this change adds; the rest are gaps next to the fixes.
Must fix: none.
Optional
scrollIntoViewon an off-screen row can now wait out the whole action deadline and then fail, and a tap, check or right-click on that row waits the same time before failing.revealis behind all four (actions/mod.rs:361,:460,:469,values.rs:42). AfterAXScrollToVisibleit polls untilplacementanswersOk(Shown)(actions/mod.rs:344). With this change a gone element makesplacementanswerErr(AX_INVALID_ELEMENT), which never equalsOk(Shown). So a row whose element the list replaces as it scrolls in keeps the poll going until the deadline, then fails unconfirmed, and sincerefCommandcounts these as input, the engine reportsACTION_MAY_HAVE_COMMITTED(driver.ts:264). On the merge base the replaced element read as shown:scrollIntoViewpassed, and a tap failed at once with the same error. I traced this by reading. I did not check live how often AppKit or SwiftUI lists replace a row's element on scroll. Please end the poll as soon asplacementsays the element is gone, with a message that says it was replaced. Should that failure let the locator try again? A scroll was sent, so it is marked delivered today, and the engine will not retry it.- Your PR description says "The unit tests cover the mappings." They cover the secure count. I ran 24 mutants over the branches this PR adds or changes, and 17 left
cargo testgreen. Among them:element_attributedropping a stall again (actions/mod.rs:121), the frontmost check after the first-key re-check removed (actions/typing.rs:102),read_frameandplacementreading a gone element as no frame again, the stepper's stall read falling through to "cannot be set", andscroll_byignoring the role (actions/scroll.rs:111). Four of the five stepper messages can name the value again with no test failing; only "steps past the value" is checked (actions/mod.rs:636). Can we either say under## Verifiedwhich mappings are checked by reading only, or split the stall mapping out the waysecure_countis, so a test can feed itAX_CANNOT_COMPLETE? For the messages, asserting that no ASCII digit appears in the wrap and "already showed"step_tofailures would cover the secret case the doc comment atvalues.rs:136promises. - A stepper fill can still report "may have committed" after a stall when nothing was pressed.
set_valuenow maps a stalled firstAXValueread to a retryable stall, but readsAXValueagain right after throughnumber(), which turns a stall intoNone(actions/values.rs:258).step_tothen returnsOk(false)without a step (values.rs:145), and the fill fails unconfirmed as "stopped short of the value". This is older than this PR, but it sits right next to the fix. Passing the number the first read already holds asshownwould close it. - The stall fix covers the five reads the #2322 review named. The same question still gets the old answer in four places:
raise(actions/mod.rs:297),focus(actions/mod.rs:415),holds_focusreading a sheet'sAXParent(windows.rs:179), andwindows::list(windows.rs:190).holds_focusis on the path ofkey_windowand oftype's window checks (typing.rs:33and:90), so a key for a field in a sheet whose app stalls onAXParentstill gets a non-retryable "not the app's key window". Can these go throughelement_attributetoo? - Which error should a node swipe give when nothing scrolls? A node swipe on a SwiftUI scroll area with no scroll bar for the axis, and no scroll area above it, now fails with
ACTION_NOT_SUPPORTED"nothing here scrolls down" (actions/scroll.rs:114). The engine maps that toUNSUPPORTED_CAPABILITY(driver.ts:268), and when that error ends an agent step,toAgentErrorfiles it asPOLICY_DENIED(packages/core/src/agent/error.ts:142). A window swipe with nothing to scroll saysNOT_ACTIONABLEinstead (surface.ts:975). Failing is what the #2322 review asked for. The question is only the class: should a list that fits read as "not actionable", like the window case, rather than as a capability the engine lacks?
Verified
- The #2322 asks at this head, each read against the code: the scroll rule (
scrolls_itself, the same rule assnapshot.rs:461-468, used by bothscrollandscroll_by); the frontmost read after the first-key re-check; the row text walk (children before the text, scroll bars skipped, assnapshot.rs:701-756does; a second walk whose order matches, not one shared walk); the secure count on a gone field;read_frameandplacementpassing a gone element up; the five focus reads throughelement_attribute; the stepper stall read; and the five stepper messages naming no value. - A stall in the middle of typing does not cause a retyped string: a check failure after the first key goes through
stopped(...).delivered()(input.rs:339-345), anddriver.ts:264maps it toACTION_MAY_HAVE_COMMITTEDbefore the retryable case. - At
b19515d66with Rust 1.100.0:cargo fmt --all --check,cargo clippy --workspace --locked --all-targets -- -D warningsandcargo test --workspace --locked(59 passed) all exit 0. The merge base runs 56. - Suites at
b19515d66, run here:pnpm run build,pnpm --filter @e2e-dev/desktop run build:native(the addon from this crate),pnpm check, and the@e2e-dev/desktoppackage tests with that addon present: all exit 0, and the desktop suite passed 248 of 248 in 7 files, its loader test loading the arm64 addon built from this commit. - New tests: 3 added and 1 changed, and each fails under at least one mutant: the scroll rule test (mutants that accept a scroll area by its page action, or ignore the bar), the secure count test (a gone field counted as none), the row name test (scroll bar parts read, or no descent into a text), and the stepper test's new
!contains('3')(the "steps past" message naming the target). - Mutation testing: 24 mutants, one per branch, condition or message this PR adds or changes in
crates/e2e-desktop-napi/src, each applied tob19515d66withcargo test --workspaceafter it. 7 failed at the intended test's ownassert(read by hand, sincecargo testhas no failure reporter). 17 survived: the call sites of the scroll rule inscrollandscroll_by, the stall mapping inelement_attribute,press,key_windowand the fourtypereads, the frontmost re-check, four of the five value-free messages, the stepper stall read, and the gone-element arms ofread_frameandplacement. - CI: on the first attempt,
test (24, runner)failed intests/integration/test-step.test.ts(a step timeout read as failed, not timed out) andtest (24.8.0, packages)failed inpackages/webtests/unit/host-libraries.test.ts:110(anexpect.pollon an ldd process). Neither loads this crate, and the same suites passed on the other Node versions at this commit, so I classed both as flaky. Both passed when re-run on this commit, and CI is green.
Not run
- The desktop testbed live on this commit. It opens apps on this Mac's screen, and I had no go-ahead for that during this review. Your 23 of 23 and 18 of 18 were run at the top of the stack, not at this commit.
pnpm --filter @e2e-dev/desktop-testbed testatb19515d66would close it. - A stalled focus read, a field replaced mid-fill, and a row replaced by its own scroll, live. Each needs an app that does it on cue.
- The x86_64 build of the addon. CI's
nativejob builds and checks it at this commit; I built arm64 only.
Accepted as intended
- The range refusal no longer names the number for any fill, secret or not ("the value is outside the range of this incrementor"). That is the cost of keeping a secret out of the message.
- A swipe on a SwiftUI scroll area that cannot move along the axis now goes to the scroll area above it or fails, where it used to pass. The #2322 review asked for exactly that.
For the maintainer
- The scroll rule this PR adopts, which I asked for on #2322, reads "scrolls" from a scroll bar for the axis. A SwiftUI
ScrollView(.horizontal, showsIndicators: false)may list no scroll bar while it does scroll. If so, a node swipe on such a carousel now fails or moves the area above it, where the page action used to move the carousel. The snapshot already offers noScrollthere, so only an explicit locator swipe changes. Checking one such view in Accessibility Inspector would settle it. If it lists no bar, the choices are a line in the desktop guide's scrolling row, or checking whether the page action moved anything before refusing.
Nit
- The checklist says no changeset is needed because "
@e2e-dev/desktophas not been released yet". 0.0.1 has been on npmlatestsince 2026-11-25. The pending.changeset/desktop-native-driver.mdalready bumps@e2e-dev/desktopand both platform packages for the release that first ships this driver, so no changeset is needed; the reason should say that instead.
b19515d to
196a556
Compare
|
[claude-opus-5-5] responding on behalf of kdy1 Thanks. Every optional item is fixed on this PR, now at
Also run at this PR's commit: the desktop testbed with the addon built from it passed 23 of 23, and the desktop package tests 248 of 248. Left for a maintainer: whether a |
196a556 to
4ae9658
Compare
michal-e2e
left a comment
There was a problem hiding this comment.
Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.
Reviewed at 4ae96583a (merge base 731045fae, main), the bottom of stack 2359, after my review at b19515d66.
Thanks @kdy1, all five optional items and the nit are done in the five new commits, and the description now matches. Nothing blocks this one.
Must fix: none.
Accepted as intended
- A row replaced as it scrolls in now fails at once instead of waiting out the poll, and still fails as one that may have taken effect. Your description gives the reason:
after_scrollcounts the scroll as input for every failure after it. - A swipe with nothing to scroll is now
ACTION_FAILED, read asNOT_ACTIONABLElike the window case.
Follow-ups
- The six branches your description lists as checked by reading only (the replaced-row exit, the stepper's first read, the stall in
raise,holds_focusand the window list, and scroll's error code) can get tests once #2356's fake tree is in.
Verified
git range-diffagainst my last review: the seven original commits are unchanged apart from the rebase onto main731045fae, and five new commits (6969743d9to4ae96583a) add the fixes. The delta is Rust only, in six files undercrates/e2e-desktop-napi/src.- Each earlier item, read at this head:
revealends its poll onAX_INVALID_ELEMENT(actions/mod.rs:375-377).set_valuesteps from the number its first read showed (shown_number,values.rs:219).raise,focus,holds_focusandwindows::listgo through the onestalledmapping.- A swipe with nothing to scroll answers
ACTION_FAILED. - A new test asserts that no stepper failure has a digit in it.
- The description and checklist are updated.
- At
4ae96583awith Rust 1.100.0:cargo fmt --all --check,cargo clippy --workspace --locked --all-targets -- -D warningsandcargo test --workspace --locked(62 passed) exit 0.pnpm run build,pnpm --filter @e2e-dev/desktop run build:nativeandpnpm checkexit 0. The desktop suite passed 248 of 248 with the addon built from this commit. - Mutation testing on the new branches, plus the two message mutants that survived last time: 10 mutants, each applied to
4ae96583awithcargo test --workspace. 4 failed at the intended test's own assertion (read by hand):stalleddropping a stall,shown_numberreading a gone stepper as no number, and both message mutants, which the new no-digit test now catches. 6 survived, the six branches in the follow-up above.
Not run
- The desktop testbed on this Mac's screen; your 23 of 23 at this commit is taken as reported.
- This commit's own CI was still running when I read it.
…for the axis SwiftUI gives every scroll area the AXScroll*ByPage actions, also one whose content fits or that scrolls only along the other axis. `scroll` counted the page action for the direction as "scrolls itself", so a swipe down on a horizontal carousel inside a vertical page sent AXScrollDownByPage to the carousel, moved nothing, and answered success. `scrolls_itself` now uses the rule the snapshot offers `Scroll` with: a scroll bar for the axis, or, for any role but a scroll area, the page action. A scroll area without that bar hands the swipe to the scroll area above it, and with none is refused as "nothing here scrolls". Review: michal-e2e on #2322 at e7a74d4 (must fix). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… last The focus reads before a key went through `Element::element()`, which drops a stall: an app slow to answer AXFocusedUIElement or AXFocusedWindow got "the field lost keyboard focus", a refusal the engine does not retry, where every other stalled read is a retryable APP_UNRESPONSIVE. `element_attribute` keeps the stall, and `type`, `press`, and `key_window` read focus through it. Past the first typed key, an unanswered read still only shortens the wait for the next key. A headed `type` also re-read the field's focus after its AXFrontmost check for the first key. That read waits on the app, and another app that came forward meanwhile would take the key. The frontmost check is now the last read before the first physical key, as it is for `press`. Review: michal-e2e on #2322 at e7a74d4 (optional). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`read_frame` and the parent reads in `placement` read AX_INVALID_ELEMENT as no frame and no parent, so a gone element was `Placement::Shown` and `scrollTo` answered success before any scroll. Before the reveal rewrite, AXScrollToVisible refused a gone element as stale. `read_frame` and `placement` now pass AX_INVALID_ELEMENT up as they pass a stall, and `reveal` maps it to the retryable STALE_REF. `frame()` still reads any failure as no frame. Review: michal-e2e on #2322 at e7a74d4 (optional). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A secure fill checks AXNumberOfCharacters after the write. A field that a change handler replaced answers AX_INVALID_ELEMENT there, which read as "counts none", so the fill succeeded unchecked. `secure_count` now treats a gone field like a stall: no proof the field counts none, so the fill ends unconfirmed unless the count shows the whole text, as a plain field's fill does. Review: michal-e2e on #2322 at e7a74d4 (optional). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fill on a stepper whose AXValue cannot be written reads the value to see that it shows a number. A read the app did not answer in time fell through to "the value of this stepper cannot be set", a non-retryable ACTION_NOT_SUPPORTED. It is now the retryable APP_UNRESPONSIVE (and a gone element a stale ref), as every other stalled read is. Review: michal-e2e on #2322 at e7a74d4 (follow-up). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stepper's failures printed the fill text and the parsed target, and the engine copies the driver's message into the step's error. The secret ledger matches a secret in every spelling a serializer gives it, but not re-parsed as a number, so a secret `0042` filled into a stepper would print as `42`. The five messages (out of range, stopped short, wraps, already showed, steps past) now say "the value" and "where it started" instead of numbers. Review: michal-e2e on #2322 at e7a74d4 (for the maintainer). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`row_texts` stopped at a text child and read only that child's own label, while the snapshot walks into it and names the row from every text below. A row holding "Invoice" and an untitled heading over "Paid" was "Invoice Paid" to a locator but "Invoice" to `select`. `gather_texts` now walks the way the snapshot gathers a name from content: every level, a text's children before the text itself, and no scroll bar's parts. It takes the tree reads as closures, so a unit test pins the order on a fake tree. Review: michal-e2e on #2322 at e7a74d4 (optional). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…it in After `AXScrollToVisible`, `reveal` polled until the element read as shown. Since the gone-element fix, `placement` answers a replaced element with `AX_INVALID_ELEMENT`, which never reads as shown, so a tap, check, or scrollIntoView on a row the list replaces as it scrolls in waited out the poll and then failed as "still off screen". It now ends the poll at once with `STALE_REF`, delivered like any failure after that scroll, as `after_scroll` counts it. Found by michal-e2e's review of #2353. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`set_value` mapped a stalled first `AXValue` read to a retryable stall, then read `AXValue` again for the number to step from, a read that turned a stall into no number. `step_to` then returned without a step, and the fill failed unconfirmed as "stopped short of the value" with nothing pressed. The first read's number is now where stepping starts. The read is split into `shown_number`, so a unit test feeds it a stall and a gone element. Found by michal-e2e's review of #2353. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The stall fix covered the five focus reads #2322's review named. Four more places still read a stall as an answer: `raise` read a stalled `AXFrontmost` or `AXFocusedWindow` as "could not be brought forward"; `focus` read a stalled `AXFocusedUIElement` as no focus; `holds_focus` read a stalled sheet `AXParent` as another window, so a key for a field in a sheet got a non-retryable "not the app's key window"; and `windows::list` listed every window as unfocused. Each now fails with the retryable `APP_UNRESPONSIVE`, before anything is sent where the read comes first. `stalled` is the one mapping they share, and a unit test feeds it `AX_CANNOT_COMPLETE`. Found by michal-e2e's review of #2353. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A node swipe where nothing scrolls along the axis failed with `ACTION_NOT_SUPPORTED`, which the engine reads as `UNSUPPORTED_CAPABILITY` and an agent step reports as `POLICY_DENIED`. A window swipe with nothing to scroll already fails as `NOT_ACTIONABLE`; the node swipe now does too (`ACTION_FAILED`), with the same "nothing here scrolls" message. Raised by michal-e2e's review of #2353. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The doc comment on `step_to` promises its failures name no value, since a secret filled into a stepper could come back re-parsed (`0042` as `42`), where the ledger would not redact it. Only the "steps past" message was checked. The test now drives every failure `step_to` gives: a wrap, a step past and back, a step past that cannot go back, a probe that left the value changed, and one out of time. It asserts no ASCII digit appears in any of them. Asked for by michal-e2e's review of #2353. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4ae9658 to
8ea401c
Compare
michal-e2e
left a comment
There was a problem hiding this comment.
Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.
Reviewed at 8ea401cdb (merge base 27fd3763f, main), the bottom of stack 2359, after my review at 4ae96583a.
@kdy1, this push is a rebase onto main, which now has #2347. git range-diff shows the same twelve commits, and the one that differs, 1366a7bdd, differs only in a context line next to #2347's new tests. So my last review carries over: nothing blocks this one.
Must fix: none.
Verified
git range-difffrom4ae96583ato8ea401cdb: 11 of 12 commits unchanged,1366a7bddchanged in one context line. Between the two heads, the lines added and removed undercrates/are exactly #2347's, and this PR adds no line to theperformandansweredcode that #2347 changed.- At
8ea401cdbwith Rust 1.100.0:cargo fmt --all --check,cargo clippy --workspace --locked --all-targets -- -D warningsandcargo test --workspace --locked(63 passed, one more than last time, from #2347) exit 0. - CI at this commit: every check passed, the macOS
nativejob included.
Not run
- The desktop testbed on this Mac's screen, as before.
The follow-up from my last review still stands: tests for the six branches checked by reading only, once #2356's fake tree is in.
…NG-1533) (e2e-inc#2355) * fix(desktop): let a scroll area scroll itself only with a scroll bar for the axis SwiftUI gives every scroll area the AXScroll*ByPage actions, also one whose content fits or that scrolls only along the other axis. `scroll` counted the page action for the direction as "scrolls itself", so a swipe down on a horizontal carousel inside a vertical page sent AXScrollDownByPage to the carousel, moved nothing, and answered success. `scrolls_itself` now uses the rule the snapshot offers `Scroll` with: a scroll bar for the axis, or, for any role but a scroll area, the page action. A scroll area without that bar hands the swipe to the scroll area above it, and with none is refused as "nothing here scrolls". Review: michal-e2e on e2e-inc#2322 at e7a74d4 (must fix). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): read focus before a key as a stall, and check frontmost last The focus reads before a key went through `Element::element()`, which drops a stall: an app slow to answer AXFocusedUIElement or AXFocusedWindow got "the field lost keyboard focus", a refusal the engine does not retry, where every other stalled read is a retryable APP_UNRESPONSIVE. `element_attribute` keeps the stall, and `type`, `press`, and `key_window` read focus through it. Past the first typed key, an unanswered read still only shortens the wait for the next key. A headed `type` also re-read the field's focus after its AXFrontmost check for the first key. That read waits on the app, and another app that came forward meanwhile would take the key. The frontmost check is now the last read before the first physical key, as it is for `press`. Review: michal-e2e on e2e-inc#2322 at e7a74d4 (optional). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): refuse scrollTo on a gone element as a stale ref `read_frame` and the parent reads in `placement` read AX_INVALID_ELEMENT as no frame and no parent, so a gone element was `Placement::Shown` and `scrollTo` answered success before any scroll. Before the reveal rewrite, AXScrollToVisible refused a gone element as stale. `read_frame` and `placement` now pass AX_INVALID_ELEMENT up as they pass a stall, and `reveal` maps it to the retryable STALE_REF. `frame()` still reads any failure as no frame. Review: michal-e2e on e2e-inc#2322 at e7a74d4 (optional). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): do not confirm a secure fill by a field that went away A secure fill checks AXNumberOfCharacters after the write. A field that a change handler replaced answers AX_INVALID_ELEMENT there, which read as "counts none", so the fill succeeded unchecked. `secure_count` now treats a gone field like a stall: no proof the field counts none, so the fill ends unconfirmed unless the count shows the whole text, as a plain field's fill does. Review: michal-e2e on e2e-inc#2322 at e7a74d4 (optional). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): retry a stepper whose value read stalls A fill on a stepper whose AXValue cannot be written reads the value to see that it shows a number. A read the app did not answer in time fell through to "the value of this stepper cannot be set", a non-retryable ACTION_NOT_SUPPORTED. It is now the retryable APP_UNRESPONSIVE (and a gone element a stale ref), as every other stalled read is. Review: michal-e2e on e2e-inc#2322 at e7a74d4 (follow-up). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): name no value in a stepper's failure messages The stepper's failures printed the fill text and the parsed target, and the engine copies the driver's message into the step's error. The secret ledger matches a secret in every spelling a serializer gives it, but not re-parsed as a number, so a secret `0042` filled into a stepper would print as `42`. The five messages (out of range, stopped short, wraps, already showed, steps past) now say "the value" and "where it started" instead of numbers. Review: michal-e2e on e2e-inc#2322 at e7a74d4 (for the maintainer). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): name a list row for select as the snapshot names it `row_texts` stopped at a text child and read only that child's own label, while the snapshot walks into it and names the row from every text below. A row holding "Invoice" and an untitled heading over "Paid" was "Invoice Paid" to a locator but "Invoice" to `select`. `gather_texts` now walks the way the snapshot gathers a name from content: every level, a text's children before the text itself, and no scroll bar's parts. It takes the tree reads as closures, so a unit test pins the order on a fake tree. Review: michal-e2e on e2e-inc#2322 at e7a74d4 (optional). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): stop waiting on a row the list replaced as it scrolled it in After `AXScrollToVisible`, `reveal` polled until the element read as shown. Since the gone-element fix, `placement` answers a replaced element with `AX_INVALID_ELEMENT`, which never reads as shown, so a tap, check, or scrollIntoView on a row the list replaces as it scrolls in waited out the poll and then failed as "still off screen". It now ends the poll at once with `STALE_REF`, delivered like any failure after that scroll, as `after_scroll` counts it. Found by michal-e2e's review of e2e-inc#2353. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): step a stepper from the number its first read showed `set_value` mapped a stalled first `AXValue` read to a retryable stall, then read `AXValue` again for the number to step from, a read that turned a stall into no number. `step_to` then returned without a step, and the fill failed unconfirmed as "stopped short of the value" with nothing pressed. The first read's number is now where stepping starts. The read is split into `shown_number`, so a unit test feeds it a stall and a gone element. Found by michal-e2e's review of e2e-inc#2353. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): read a stall as one in raise, focus, and the window list The stall fix covered the five focus reads e2e-inc#2322's review named. Four more places still read a stall as an answer: `raise` read a stalled `AXFrontmost` or `AXFocusedWindow` as "could not be brought forward"; `focus` read a stalled `AXFocusedUIElement` as no focus; `holds_focus` read a stalled sheet `AXParent` as another window, so a key for a field in a sheet got a non-retryable "not the app's key window"; and `windows::list` listed every window as unfocused. Each now fails with the retryable `APP_UNRESPONSIVE`, before anything is sent where the read comes first. `stalled` is the one mapping they share, and a unit test feeds it `AX_CANNOT_COMPLETE`. Found by michal-e2e's review of e2e-inc#2353. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): refuse a swipe with nothing to scroll as not actionable A node swipe where nothing scrolls along the axis failed with `ACTION_NOT_SUPPORTED`, which the engine reads as `UNSUPPORTED_CAPABILITY` and an agent step reports as `POLICY_DENIED`. A window swipe with nothing to scroll already fails as `NOT_ACTIONABLE`; the node swipe now does too (`ACTION_FAILED`), with the same "nothing here scrolls" message. Raised by michal-e2e's review of e2e-inc#2353. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(desktop): check that no stepper failure names a value The doc comment on `step_to` promises its failures name no value, since a secret filled into a stepper could come back re-parsed (`0042` as `42`), where the ledger would not redact it. Only the "steps past" message was checked. The test now drives every failure `step_to` gives: a wrap, a step past and back, a step past that cannot go back, a probe that left the value changed, and one out of time. It asserts no ASCII digit appears in any of them. Asked for by michal-e2e's review of e2e-inc#2353. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(desktop): install rustup from a pinned, checksum-verified rustup-init Both `native` jobs ran `curl https://sh.rustup.rs | sh` when the image had no rustup, and the release job builds the driver npm ships right after it. The new `.github/actions/rust-toolchain` composite action downloads rustup-init 1.29.3 for the runner's architecture from static.rust-lang.org and checks it against the SHA-256 recorded in the action before it runs it. It then installs the toolchain rust-toolchain.toml pins and puts that toolchain's cargo first on PATH, the step spec's job already had; the release job now runs it too, which build-native.ts did implicitly through rustup before. rust-toolchain.toml stays the toolchain pin. Answers the follow-up from the e2e-inc#2325 review (okwasniewski): the release job's rustup install was an unpinned curl | sh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(desktop): load the x64 addon under Rosetta before it ships The x64 driver was built and its architecture read with lipo, but no job loaded it, so a build that fails to dlopen or to answer would reach Intel users unnoticed. The new `.github/actions/load-x64-addon` composite action installs Rosetta when `arch -x86_64` cannot run, downloads the official darwin-x64 Node of the version setup-node installed, checks the tarball against that release's SHASUMS256.txt, and has it require the x64 addon under `arch -x86_64` and call status(). It fails on a Node that is not x64, a load failure, or a status() without a boolean `accessibility`. Spec's `native` job runs it after the arm64 load. The release job's `native` job now loads both builds, the arm64 one natively and the x64 one this way, before it uploads them. The engine's loader test stays arm64 only: vitest's native dependencies are installed for arm64. Answers the follow-up from the e2e-inc#2325 review (okwasniewski): the x64 addon is built but never loaded by any job. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(desktop): pick rustup-init by OS and architecture together The rustup step chose its binary by `uname -m` alone, so a Linux x86_64 job using the action would download the macOS build, pass the checksum, and fail with an exec format error. It now matches `Darwin arm64` and `Darwin x86_64`, and anything else gets the message it already printed: no pinned rustup-init for that OS and architecture. Raised by michal-e2e's review of e2e-inc#2354. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci(desktop): retry the rustup-init and x64 Node downloads The native job runs on every pull request and `spec gate` needs it, so a single 5xx or reset from static.rust-lang.org or nodejs.org failed every pull request and merge-queue entry until a rerun. Each download now retries 3 times, as `mcp-publisher` already does. Raised by michal-e2e's review of e2e-inc#2354. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(mcp): print a test line for every point tool The point tools (tap_at, hover_at, drag_at, type_at, press_at, select_at) printed no test line, so test_lines left their steps out of the draft without saying so: a tab tapped and a field edited at a point were missing from a desktop draft. Each point tool now plans its line the way the step resolves its target, through the step's own hit test on the newest screen. Where the engine takes the bare point, a tap prints screen.tapAt({ x, y }) in the viewport's CSS pixels; elsewhere the tool acts on the listed control under the point by id and prints that control's locator line (tap, hover, fill, press, selectOption, dragTo). A hover or a drag at bare points, and a typed key on a point where nothing is listed, print "No test line:" and why, and the draft keeps the step as a comment. A point tool called before the first screenshot does nothing and records nothing. Answers okwasniewski's e2e mcp pass on e2e-inc#2323 (2026-11-26T17:54). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(mcp): write the line of an earlier screen's id for the node it acted on An action on a node id from an earlier observation ran, then answered "No test line: not on the newest screen". The step resolves the id as an agent step does (feed.resolve): an id the newest observation no longer lists is found again by what its node read as, when exactly one node on the newest screen reads the same, and the action runs on that node. The test line looked the id up on the newest screen only. Keeping the action is the decision here, not refusing it before it acts: it is the agent's own resolution, the node it acts on is on the newest screen, a secret fill still runs the full authorization on that node, and an engine that numbers every screen afresh (SwiftUI) would otherwise fail every second call of a batch. The line now keeps the screens before the newest one, as the step does, and finds the same node; two nodes that read alike give no line, as the action fails then. The MCP reference said ids were valid only against the newest observation; it now says how an earlier id resolves. Answers okwasniewski's e2e mcp pass on e2e-inc#2323 (2026-11-26T17:54). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(core): let a fixture operation say how a test line writes its call `e2e mcp`'s test_lines wrote desktop.useWindow({ id: '36086', ... }): the window id run_code passed, which no window has on the next launch, so the drafted line never replays. A fixture operation may now declare testLine (FixtureOperation, in @e2e-dev/core/engine): for an argument that holds only while the app runs, the arguments as a test writes them to find the same thing again, or a note the line carries on why the arguments may not hold. The fixture recorder keeps it by the recorded method, and run_code's recorder asks it before it writes a line, with every string in the arguments through the secret ledger. Core still names no engine: the desktop engine declares it for useWindow, which now drafts as desktop.useWindow((await desktop.windows()).find((window) => window.title === "Inbox")), the form the testbed's own tests use; an untitled window or a bare id keeps its arguments with a comment that the id holds only while the window is open. Answers okwasniewski's e2e mcp pass on e2e-inc#2323 (2026-11-26T17:54). The only change in packages/desktop is the useWindow declaration and its unit test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(mcp): give attached run_code the engine's fixtures run_code in a session attached to a held test (open_session { attach }) had no engine fixture: `desktop is not defined`, even when the test names it, while a standalone session's code has it. On macOS 27 the attached agent then could not pick the real window back with desktop.useWindow() once a system dialog took the screen. Core's new createEngineFixtures builds the engine's own fixtures over a session, each on first touch, as a test's are, recording into the step recorder and budget it is given. The held test's tools give run_code those fixtures over the held test's session, beside the app they already built, with the attachment's own step recorder: the calls stay out of the test's report, and a --step hold never stops one of them, which recording into the test's recorder would. What a fixture changes lives in the engine session, so the test sees it after it resumes. Answers okwasniewski's e2e mcp pass on e2e-inc#2323 (2026-11-26T18:09). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): draft a useWindow line that fails when no window has the title The drafted `useWindow` line found the window by title, and on replay with no window of that title `find` returned `undefined`, which `useWindow` takes as "go back to the focused window": the test then read and asserted on another window with no error. The line now ends with `?? "titled Inbox"`, an id `useWindow` refuses with "the app has no window titled Inbox". It drafts by title only when the title is a non-empty string; a window object with none, as plain JavaScript can pass, keeps the id and its note. Found by michal-e2e's review of e2e-inc#2355. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(desktop): raise the core and e2e peer floor to the release with testLine `@e2e-dev/desktop` now declares `FixtureOperation.testLine`, which `@e2e-dev/core` 0.25.0 does not have; on it the window line is drafted with the id again, without a word. Both peers now read `>=0.25.1 <1`, as the web and mobile engines already do. Found by michal-e2e's review of e2e-inc#2355. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(mcp): keep one set of engine fixtures for an attachment's run_code `run_code` asks for its attempt on every call, and the held test's attachment built new engine fixtures each time. State a fixture keeps did not carry from one call to the next: a web route added in one call lived on that call's `browser`, so `unroute` in the next removed nothing and the route was still there when the test resumed. The attachment now builds the attempt once, on the first call, as a standalone session keeps its own, and each call enters its own phase of the attachment's one budget, cancelled with that call. The new test sets a property on the fixture in one call and reads it in the next; on the per-call fixtures it reads nothing. Found by michal-e2e's review of e2e-inc#2355. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * feat(core): carry a node's test id on ExecutorNode The listing an executor reads shows a node's test id (`testid="..."`), but `ExecutorNode` had no field for it, so code working from the tree could not tell apart two controls only their test ids separate. `projectTree` now copies `testId` onto the node. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(mcp): find an earlier screen's id for its line by the action's own rule The line for an id only an earlier screen listed re-found the node with its own `twinsOf`, which compares role, name, text, and placeholder and ignores the test id, while the action re-finds it with `describeTarget` and `relocateDescriptor`, which go by role, name, test id, placeholder, and input purpose. Two "Delete" buttons with different test ids, renumbered: the tap landed on the right one and the line said "not on the newest screen". Two nameless rows whose text swapped: the line named the row the action did not touch. The line now calls the same two functions on the listed nodes. Found by michal-e2e's review of e2e-inc#2355. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(mcp): tell the agent an older node id works when one node reads like it `open_session` still said node ids are valid only for the newest observation, while the docs and the skill say an older id is found again when exactly one node on the newest screen reads like its node. Its text now says the same, and the reference names the fields the action goes by: role, name, test id, placeholder, and the text of a node with neither a name nor a test id. Raised by michal-e2e's review of e2e-inc#2355. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(mcp): replay a drafted check line beside the tap_at lines The point-tool change replaced the `check` step with a `tap_at` on the checkbox and left the `check` entry as dead data, so no drafted `.check()` line was replayed. The checkbox is checked with `check` again, then tapped twice at its point with `tap_at`, off and on, and every line replays in the run. Raised by michal-e2e's review of e2e-inc#2355. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Oskar Kwaśniewski <oskar@okwasniewski.com>
What
Fixes to the macOS desktop driver: the items the last review of #2322 (michal-e2e at
e7a74d44e) asked for that missed the merge, and the ones michal-e2e's review of this PR found next to them.nothing here scrolls down), where it used to do nothing and pass.APP_UNRESPONSIVE), not as a wrong answer, intype,press,raise,focus, and the window list. A headedtypechecks that the app is still frontmost right before its first key.scrollToon a gone element fails with a stale ref instead of passing. A tap or check on a row the list replaces as it scrolls the row in fails at once, where it waited out the scroll poll.fillwhose field was replaced is unconfirmed, not a success.0042as42).selectOptionnames a list row the way the snapshot does, so a row with an untitled heading over "Paid" is "Invoice Paid" to both.Why
#2322 merged with these items unanswered. The scroll one was a must-fix: a swipe that moves nothing reported success. The others turn a slow app into a non-retryable failure, a gone element into a pass, or let a stepper message carry a secret.
How it works
scrolls_itself(crates/e2e-desktop-napi/src/actions/scroll.rs:43) is the snapshot's rule forScroll: a scroll bar for the axis, or the page action for any role but a scroll area.scrollandscroll_byboth use it. When nothing scrolls, the refusal isACTION_FAILED(scroll.rs:115), which the engine reads asNOT_ACTIONABLE, as for a window with nothing to scroll;ACTION_NOT_SUPPORTEDread asUNSUPPORTED_CAPABILITY, which an agent step reports asPOLICY_DENIED.stalled(actions/mod.rs:118) is the one stall mapping:AX_CANNOT_COMPLETEpasses up, any other failure reads as no answer.element_attribute(:128) uses it for the focused element and window intype_text,press, andkey_window;raise(:297, throughforward),focus(:453),holds_focus(windows.rs:179, a sheet'sAXParent), andwindows::listuse it too.type_textreadsfrontmostonce more as the last read before a physical first key (actions/typing.rs:107).read_frame(ax.rs:364) andplacement(snapshot.rs:326) passAX_INVALID_ELEMENTup, sorevealanswersSTALE_REFfor a gone element. AfterAXScrollToVisible,revealends its poll as soon as the element is gone (actions/mod.rs:374), delivered like any failure after that scroll.secure_count(actions/values.rs:327) treats a gone field like a stall: no proof the field counts none.shown_number(actions/values.rs:219) reads a stepper's value before it decides the stepper shows no number: a stall or a gone element fails before any press. Stepping starts from that number (:263), not from a second read.step_toandset_valuedrop the target, the fill text, and the stepper's values from their messages (actions/values.rs:136).gather_texts(actions/select.rs:85) walks a row the way the snapshot gathers a name from content: every level, a text's children before the text. It takes the tree reads as closures, so a unit test drives it with a fake tree.A row replaced as it scrolls in still fails as an action that may have taken effect, not one the locator retries:
after_scrollcounts the scroll as input, and that rule holds for every failure after it.Issue
Review items left open on #2322, and michal-e2e's review of this PR.
Verified
Ran it locally: yes (macOS 27.2.1, arm64, background mode)
pnpm --filter @e2e-dev/desktop-testbed testpassed 23 of 23. The desktop package tests with that addon passed 248 of 248.AX_CANNOT_COMPLETEto the stall mapping (stalled,unread) and toshown_number, drive everystep_tofailure and assert no digit is in its message, and cover the scroll rule, the secure count on a gone field, and the row name order on a fake tree. Mutants that drop the stall installedorshown_number, or put the value in the wrap or "already showed" message, each fail a test.scrolls_itselfinscrollandscroll_by, the frontmost re-check before the first key, the gone-element arms ofread_frameandplacement, and the replaced-row exit inreveal.Checklist
pnpm changeset) for any change to a published package, or the change is testbed, docs, or CI only. None: the pending.changeset/desktop-native-driver.mdbumps@e2e-dev/desktopand both platform packages for the release that first ships this driver, and these are fixes to it.!, the changeset body names what breaks and what replaces it, and the deprecation warning landed a window earlier (stability policy in CONTRIBUTING.md).docs/**/*.mdxpage for the behavior, andskills/e2e/if the skill describes it. No behavior the docs describe changed..d.tsreviewed,tests/types/sdk-types.tsupdated; wire change edits the schema and both fixtures.e2e/engine): changesets fore2e,@e2e-dev/web, and@e2e-dev/mobile.🤖 Generated with Claude Code