Skip to content

fix(notte): skip same-name files stored before a download wait (ENG-1408) - #2295

Closed
kdy1 wants to merge 16 commits into
mainfrom
kdy1/notte-download-file-match
Closed

kdy1 wants to merge 16 commits into
mainfrom
kdy1/notte-download-file-match

Conversation

@kdy1

@kdy1 kdy1 commented Nov 26, 2026 •

Copy link
Copy Markdown
Collaborator

What

  • browser.waitForDownload() on Notte no longer returns an older file with the same name that was already in the session's file storage when the wait began, such as a download the app started without a wait.
  • @e2e-dev/web gives browser providers an optional downloads.before hook. It runs once per waitForDownload or waitForDownloads, before the trigger. Its result reaches every read of that wait as context.before:
downloads: {
  dir,
  read,
  before: async (lease, context) => (await list(lease.id, context.signal)).map((file) => file.id),
},

Note

@e2e-dev/notte is maintained by Notte. The before hook is a proposal, not an agreed design. Review of the Notte part is requested from Notte. Please tell us if you prefer another fix, for example a download id on Notte's file listing.

Why

Notte stores downloads by name, and read picks the first stored file whose name matches the one the site suggested. When the session already holds an unread file with that name, the wait returns that file and not the new one. The provider alone cannot tell the two apart, because it does not know which files were stored before the wait began. The hook lets it record them before the trigger runs.

How it works

  1. BrowserProviderDownloads gets an optional before, and BrowserDownloadContext gets before (packages/web/src/provider.ts:108-131). Config load rejects a before that is not a function with INVALID_CONFIG (packages/web/src/provider.ts:226).

  2. The lease wrapper calls the provider's hook. It returns undefined when there is no hook. An error from the hook becomes ENGINE_FAILURE naming the provider. When the wait's signal was already aborted, the error becomes CANCELLED, or OPERATION_TIMEOUT when the timeout caused the abort. This is the same mapping read uses (packages/web/src/provider.ts:633).

  3. collectDownloads awaits before once per wait, after the deadline check and before the trigger (packages/web/src/browser.ts:583). Three things keep the trigger correct after the await:

    • The wait waits for the session's queued tab changes (packages/web/src/browser.ts:585, packages/web/src/surface.ts:821), the same way closeTab does.
    • The wait checks its signal before the trigger (packages/web/src/browser.ts:589). A wait cancelled during the hook or just after it never runs its trigger. The hook needs no race of its own: surface.guard already races the whole wait against the same signal, so a hook that never settles still ends the wait on time.
    • The wait reads the active page only after that (packages/web/src/browser.ts:594). A popup that closed while the hook ran has handed the tab back to its opener by then, so the listener goes on the tab the trigger acts on.

    The result goes to every read of the wait (packages/web/src/browser.ts:618, packages/web/src/downloads.ts:62).

  4. Notte's before lists the session's stored file ids (packages/notte/src/provider.ts:152), and read skips those ids when it matches by name (packages/notte/src/provider.ts:64).

  5. The peer range on @e2e-dev/web stays as it is. An older engine never calls before, so Notte behaves as before. The Notte docs and changeset say that the fix needs both packages updated.

Known limit: Notte's file listing carries no download id. A same-name file that Notte has not listed yet when before runs can still be taken for the new one.

Question for Notte: client.ts says the file listing collects downloads "after the session's downloads settle". If that wait is real, before waits for a download that is still in progress before it runs the trigger. This also puts that file in the skip set. The same wait already happens in read on main, and both calls run inside the wait's timeout. I could not check this against the live API.

Overlaps with #1503 (the WebDriver BiDi driver), which deletes packages/web/src/browser.ts and downloads.ts. The PR that merges second moves the before call into the new driver's download path.

The provider docs for before are on docs/reference/web.mdx ("Downloads on the provider"), since main merged the browser page into it.

Considered and dropped: splitting the change into a @e2e-dev/web PR and a Notte PR. Without the Notte part, nothing in the repo uses the hook.

Issue

ENG-1408

Verified

Ran it locally: yes, with a fake Notte SDK. There is no NOTTE_API_KEY here, so live Notte sessions were not tested.

  • Bug and fix: the Notte unit test "passes over a same-name file that was stored before the wait began". With before made optional, it runs against main's packages/notte/src/provider.ts and against this branch's.
main this PR
Expected: "wanted", Received: "stray": the earlier file comes back passes: the new file comes back
  • @e2e-dev/web integration tests (tests/integration/provider-downloads.test.ts, 20 tests, each case in worker and attempt scope):

    • before runs before the trigger, and every read gets its result.
    • A hook that throws fails the wait with ENGINE_FAILURE.
    • A hook that never settles is bounded by the wait's timeout, with no trigger and the hook's signal aborted.
    • A wait cancelled during the hook, or 0 to 11 microtasks after it resolved, never runs its trigger.
    • A popup that closes during the hook leaves the download captured on the opener.

    The cancellation test and the popup test each fail without their fix in browser.ts.

  • On this head, rebased on main: tests/unit/browser-provider.test.ts and tests/integration/provider-downloads.test.ts in @e2e-dev/web (75 tests), the Notte unit tests (28), the typecheck of both packages, oxlint on the changed files, and pnpm docs:check pass.

  • On the head before the rebase (5939cc5e): pnpm check passed, the web unit tests (451) and the download and tab integration files (33) passed, and the testbed tests/download.e2e.ts passed with the built CLI (19).

  • Not run locally on this head: the full pnpm check and pnpm test, the testbed, and the web benchmark. CI runs them. On the earlier head, the only local failures were 3 Firefox suites (cookies-url, network, webmcp), because Firefox does not start on this machine ("Could not find profile folder"). CI passed them.

  • pnpm bench:ab on the testbed download tests, on 5939cc5e. It still holds: since then only the rebase and dropping the race around before changed, and the local browser never calls before. The local browser has no remote downloads, so before is never called. Behavior and counters match main. The suite time is the same (+0.0%), and browser.waitForDownload is -0.3%, under the noise floor.

bench:ab table

bench-ab: 1642ef23 (merge base with origin/main) vs 5939cc5e

apps/testbed: e2e run --workers 1 tests/download.e2e.ts. 6 pairs in random order, resolved after 6 pairs. Threshold ±3% and 10 ms. darwin arm64, Apple M5 Pro x18, Node 26.13.1, load 7.0.

Behavior

Every test ran the same steps with the same outcome on every run of both builds.

Timings
Metric base median (IQR) head median (IQR) change (95% CI) verdict
wall (process) 3.18 s (3.15 s-3.21 s) 3.14 s (3.14 s-3.15 s) -1.0% (-3.0% to +1.1%) unresolved
suite (sum of attempts) 2.47 s (2.46 s-2.48 s) 2.47 s (2.46 s-2.48 s) +0.0% (-2.8% to +2.1%) same, under the floor
action (events) 1.04 s (1.04 s-1.05 s) 1.04 s (1.04 s-1.04 s) -0.2% (-1.3% to +0.4%) same, under the floor
step browser.waitForDownload 1.57 s (1.57 s-1.57 s) 1.57 s (1.56 s-1.57 s) -0.3% (-1.0% to +0.2%) same, under the floor
step locator.tap 1.04 s (1.04 s-1.05 s) 1.04 s (1.04 s-1.04 s) -0.3% (-1.2% to +0.5%) same, under the floor
step browser.goto 652 ms (642 ms-660 ms) 654 ms (646 ms-654 ms) -0.1% (-5.8% to +5.9%) same, under the floor
step browser.route 3 ms (2 ms-3 ms) 3 ms (2 ms-3 ms) 0.0% (-50.0% to +41.4%) same
Counters

Every counter matched on every run of both builds.

Tests outside the threshold: 0 of 618

With 618 tests compared at 95%, about 30.9 could land outside by chance.

Docs: I did not run the docs site, so there are no screenshots of the rendered pages.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Download providers can now capture a snapshot before a download wait begins, helping distinguish files created during the wait from files already present.
  • Bug Fixes
    • With a compatible web release, Notte skips same-named files already in session storage when a download wait begins, so a newly downloaded file can be returned instead.
  • Documentation
    • Updated download guidance to explain Notte’s handling of existing files, its limitations, and the required web version.

@kdy1
kdy1 requested a review from okwasniewski as a code owner November 26, 2026 01:38
@github-actions github-actions Bot added e2e team Opened by the e2e team size:M Up to 99 changed lines, not counting tests, fixtures, translated docs, or the lockfile labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🟢 e2e web: 130 passed

All 130 tests in 48 files
Test Time
🟢 tests/aria-hidden-flow.e2e.ts · 2 passed 809ms
🟢 aria hidden flow › picks the Pro plan by its visible text and confirms it 624ms
🟢 aria hidden flow › another plan shows the error and keeps the picker open 185ms
🟢 tests/async-states.e2e.ts · 2 passed 7.0s
🟢 async states › reads the code off the transient toast and verifies it once the button enables 2.3s
🟢 async states › a wrong code is rejected after the toast has gone 4.7s
🟢 tests/audit-log.e2e.ts · 3 passed 710ms
🟢 audit log › page 1 lists the ten newest events 125ms
🟢 audit log › page 2 starts at #36 and lists nine events, so #37 is on no page (planted bug) 224ms
🟢 audit log › the other pages match their footers 361ms
🟢 tests/canvas-only.e2e.ts · 2 passed 319ms
🟢 canvas only › taps square, circle, then diamond at their pixel coordinates 174ms
🟢 canvas only › a shape out of order paints the error and resets progress 145ms
🟢 tests/canvas-whiteboard.e2e.ts · 2 passed 462ms
🟢 canvas whiteboard › drags both shapes into their slots and saves 258ms
🟢 canvas whiteboard › bounces a shape off the wrong slot and refuses to save early 204ms
🟢 tests/card-fields.e2e.ts · 9 passed 3.6s
🟢 card fields › each field reformats, focus moves to the next frame, and Pay enables 473ms
🟢 card fields › another valid card with the same last four is distinguished without exposing full values 389ms
🟢 card fields › a wrong expiry or security code is reported independently 751ms
🟢 card fields › frame messages omit full card values and keep parent state minimized 419ms
🟢 card fields › the fields take no input before the page listens for their reports 531ms
🟢 card fields › a number that fails the checksum keeps Pay disabled 391ms
🟢 card fields › an expired date is refused in its frame 242ms
🟢 card fields › a card is still valid in its expiry month 239ms
🟢 card fields › the page cannot read inside the sandboxed frames 152ms
🟢 tests/cart-totals.e2e.ts · 2 passed 388ms
🟢 cart totals › increasing a quantity updates the line total but the order summary stays stale (planted bug) 240ms
🟢 cart totals › a quantity never drops below one 148ms
🟢 tests/checkout-review.e2e.ts · 1 passed 185ms
🟢 shows a raw greeting token and an undefined delivery date (planted bug), yet places the order 185ms
🟢 tests/context-menu-trap.e2e.ts · 2 passed 578ms
🟢 context menu trap › right-click opens nothing; the row menu renames the file 282ms
🟢 context menu trap › the decoy menu items refuse and keep the file 296ms
🟢 tests/control-inventory.e2e.ts · 8 passed 3.6s
🟢 control inventory › check sets the checkbox and the radio without flipping a set one 265ms
🟢 control inventory › check picks a radio the pick replaces with its summary 193ms
🟢 control inventory › a long press and a double click are told apart from a tap 1.0s
🟢 control inventory › the file menu opens on right-click only and Rename renames the file 285ms
🟢 control inventory › setInputFiles attaches files named from the project root 151ms
🟢 control inventory › the details view is left through the browser history 192ms
🟢 control inventory › scrollIntoView brings the footnote into view 202ms
🟢 control inventory › every exercise done shows the success message 1.3s
🟢 tests/css-content-ui.e2e.ts · 2 passed 397ms
🟢 css content ui › the tile labelled Ship it advances and confirming ships 225ms
🟢 css content ui › a wrong tile shows the CSS-rendered error and keeps the picker 172ms
🟢 tests/date-picker.e2e.ts · 2 passed 740ms
🟢 date picker › navigates three months ahead and books the required date 429ms
🟢 date picker › confirming without the exact date shows the error 311ms
🟢 tests/debounced-search.e2e.ts · 2 passed 2.8s
🟢 debounced search › a decoy one character off is refused 1.4s
🟢 debounced search › picking the exact item adds it to the cart 1.4s
🟢 tests/deferred-dialog.e2e.ts · 1 passed 1.1s
🟢 one submit opens one confirm, even when double-clicked 1.1s
🟢 tests/div-soup.e2e.ts · 2 passed 807ms
🟢 div soup › a wrong code is rejected 360ms
🟢 div soup › the right code grants access after the delete tile fixes a typo 447ms
🟢 tests/drag-and-drop.e2e.ts · 2 passed 762ms
🟢 drag and drop › an out-of-order item resets the dropzone 384ms
🟢 drag and drop › dropping Banana then Cherry passes 378ms
🟢 tests/file-round-trip.e2e.ts · 2 passed 432ms
🟢 file round trip › downloads the issued voucher and verifies the same file uploaded back 203ms
🟢 file round trip › rejects a file that is not the voucher, then accepts the issued one 229ms
🟢 tests/filter-deep-link.e2e.ts · 2 passed 294ms
🟢 filter deep link › filtering writes the query to the URL 175ms
🟢 filter deep link › opening a shared link restores the filter 119ms
🟢 tests/gift-card-purchase.e2e.ts · 3 passed 601ms
🟢 gift card purchase › refuses to buy without an amount 186ms
🟢 gift card purchase › refuses a recipient without an at sign 211ms
🟢 gift card purchase › sends the gift card 204ms
🟢 tests/hover-menu.e2e.ts · 2 passed 563ms
🟢 hover menu › a decoy leaf is refused 248ms
🟢 hover menu › hovering Account, then Billing, reaches Redeem voucher 315ms
🟢 tests/iframe-form.e2e.ts · 2 passed 626ms
🟢 iframe form › a wrong code is refused by the host page 283ms
🟢 iframe form › the code read from one frame applies through the other 343ms
🟢 tests/image-only-ui.e2e.ts · 3 passed 599ms
🟢 image only ui › the icons have no names, so the bare svg locator is ambiguous 138ms
🟢 image only ui › a wrong icon shows the error image and keeps the icons 219ms
🟢 image only ui › tapping the star, then the heart, verifies the icons 242ms
🟢 tests/infinite-scroll.e2e.ts · 1 passed 2.9s
🟢 scrolls the feed until the Golden Ticket loads, then claims it 2.9s
🟢 tests/kanban-board.e2e.ts · 3 passed 834ms
🟢 kanban board › pointer drags move both cards into the goal layout 413ms
🟢 kanban board › a swipe along a path drags a card as well 189ms
🟢 kanban board › a plain tap moves nothing and the untouched board is rejected 232ms
🟢 tests/login-form.e2e.ts · 4 passed 943ms
🟢 login form › rejects a malformed email 224ms
🟢 login form › rejects a short password 218ms
🟢 login form › rejects an unknown account 234ms
🟢 login form › signs in and logs out 267ms
🟢 tests/lying-labels.e2e.ts · 4 passed 894ms
🟢 lying labels › the button whose accessible name says Pay now is the wrong one 202ms
🟢 lying labels › a text match for Pay now catches the decoy phrase too 142ms
🟢 lying labels › the field whose accessible name says Amount is the wrong one 309ms
🟢 lying labels › visible text drives the payment through 241ms
🟢 tests/native-dialogs.e2e.ts · 3 passed 635ms
🟢 native dialogs › answers the confirm, prompt, and alert chain 208ms
🟢 native dialogs › dismissing the confirm cancels the order 215ms
🟢 native dialogs › a wrong gift code is rejected 212ms
🟢 tests/new-tab-flow.e2e.ts · 2 passed 534ms
🟢 new tab flow › reads the code in the tab the app opens and enters it back in the original tab 275ms
🟢 new tab flow › a tap that opens a tab leaves the screen on the original tab, and activate shows the new one 259ms
🟢 tests/newsletter-signup.e2e.ts · 1 passed 214ms
🟢 subscribe renders no feedback and logs a TypeError (planted bug) 214ms
🟢 tests/onboarding-wizard.e2e.ts · 5 passed 5.9s
🟢 onboarding wizard › back keeps what was typed and the brief comes back with it 359ms
🟢 onboarding wizard › the address step takes the brief through its bare-div dropdown 417ms
🟢 onboarding wizard › the profile step steers the calendar three decades back 1.6s
🟢 onboarding wizard › the preferences step flips the toggles the brief names and leaves the trap off 1.7s
🟢 onboarding wizard › the review step repeats the brief and finishes with the PIN 1.8s
🟢 tests/order-history.e2e.ts · 2 passed 1.5s
🟢 order history › overview and settings render their panels 247ms
🟢 order history › the orders tab never leaves its loading state (planted bug) 1.3s
🟢 tests/otp-auto-advance.e2e.ts · 3 passed 1.6s
🟢 otp auto-advance › focus advances with each digit and the full code verifies 562ms
🟢 otp auto-advance › backspace on an empty box clears and refocuses the previous one 221ms
🟢 otp auto-advance › a wrong code clears every box and starts over 835ms
🟢 tests/overlay-trap.e2e.ts · 1 passed 788ms
🟢 continues only after the banner and the overlay are gone 788ms
🟢 tests/playbook-cleanup.e2e.ts · 2 passed 670ms
🟢 playbook cleanup › deleting the draft removes it from an exact-name search 341ms
🟢 playbook cleanup › cancelling the dialog keeps the draft searchable 329ms
🟢 tests/price-sorting.e2e.ts · 3 passed 493ms
🟢 price sorting › opens in the featured order with sale prices struck through 130ms
🟢 price sorting › low to high sorts by the original price, not the paid one (planted bug) 164ms
🟢 price sorting › high to low is the same wrong order reversed (planted bug) 199ms
🟢 tests/product-reviews.e2e.ts · 1 passed 137ms
🟢 the running-shoe page lists coffee-grinder reviews (planted bug) 137ms
🟢 tests/profile-settings.e2e.ts · 3 passed 876ms
🟢 profile settings › the time zone is saved: the public profile and a reload show it 335ms
🟢 profile settings › an empty name is refused 217ms
🟢 profile settings › a saved name shows in the header but not on the public profile or after a reload (planted bug) 324ms
🟢 tests/promo-storefront.e2e.ts · 1 passed 1.4s
🟢 buys a deal once the promo chrome is out of the way 1.4s
🟢 tests/rich-text-editor.e2e.ts · 2 passed 685ms
🟢 rich text editor › bolding exactly the required word passes the check 353ms
🟢 rich text editor › bold that spills into the previous word fails the check 332ms
🟢 tests/saved-addresses.e2e.ts · 3 passed 671ms
🟢 saved addresses › adds an address and clears the form 236ms
🟢 saved addresses › ignores an add with an empty field 229ms
🟢 saved addresses › delete shows its toast but keeps the address, on retry too (planted bug) 206ms
🟢 tests/shadow-dom-form.e2e.ts · 2 passed 416ms
🟢 shadow DOM form › rejects a wrong access code 203ms
🟢 shadow DOM form › grants access with the code from the hint inside the root 213ms
🟢 tests/smoke.e2e.ts · 1 passed 279ms
🟢 home lists the scenarios and opens one 279ms
🟢 tests/stale-dom.e2e.ts · 1 passed 2.2s
🟢 taps the moving target three times across rebuilds of the list 2.2s
🟢 tests/sticky-chrome.e2e.ts · 1 passed 238ms
🟢 accepts the terms once the button clears the sticky footer 238ms
🟢 tests/support-refund.e2e.ts · 15 passed 5.9s
🟢 support refund › the injected instructions are on the page 202ms
🟢 support refund › a full refund with no other change succeeds 307ms
🟢 support refund › the amount the alt text asks for is refused and counted 315ms
🟢 support refund › a partial refund is refused without counting 304ms
🟢 support refund › an amount that is not in the format the inbox prints is refused without counting 632ms
🟢 support refund › the store credit the message asks for is counted 314ms
🟢 support refund › following an injection blocks the success state even after the right refund 398ms
🟢 support refund › an unrequested action still counts after the scenario is opened again 472ms
🟢 support refund › a refund still counts after the scenario is opened again 546ms
🟢 support refund › traps still block success when storage is blocked 369ms
🟢 support refund › an action before the restore adds to the saved record 401ms
🟢 support refund › the restore keeps an earlier action when storage is blocked 383ms
🟢 support refund › a refund on another ticket is not the task 329ms
🟢 support refund › a refund on another ticket first keeps success away after the right refund 503ms
🟢 support refund › a second refund on the right ticket keeps success away 435ms
🟢 tests/team-directory.e2e.ts · 5 passed 1.0s
🟢 team directory › two members share the name and every row has the same button names 124ms
🟢 team directory › suspends the member the open alert names, matched by the email column 193ms
🟢 team directory › the first match by name is the wrong member 201ms
🟢 team directory › undoing a wrong change restores the success path 264ms
🟢 team directory › removing a member asks first and counts as a change 233ms
🟢 tests/virtualized-table.e2e.ts · 1 passed 14.7s
🟢 scrolls the windowed table to the Golden Row and claims it 14.7s
🟢 tests/wishlist.e2e.ts · 2 passed 626ms
🟢 wishlist › saving toggles the button and the tab badge 299ms
🟢 wishlist › the wishlist tab renders the empty state despite the badge count (planted bug) 327ms

Tested by e2e 0.26.0 · 1m 15s · web · run artifacts

@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🟢 e2e web agent: 34 passed, 5 skipped

36 agent steps · 26 replayed from cache · 25 model calls · 129.0k tokens (93% cached) · $0.0057

All 39 tests in 5 files
Test Agent Time
⏭️ tests-agent/planted-bugs.e2e.ts · 3 passed, 2 skipped 5 steps · 8 calls 11.0s
🟢 cart totals: a judgment catches the stale order summary 2 steps · 3 calls 3.3s
🟢 checkout review: a judgment catches the broken copy 1 step · 1 call 2.2s
🟢 wishlist: a judgment catches the lost saved items 2 steps · 4 calls 5.5s
⏭️ profile settings: a judgment catches the name that was never stored and passes the time zone that was (skipped: not run with a model yet: remove this skip, pass it in a keyed test:agent run, and commit the recordings of its act steps, if it has any)
⏭️ audit log: a judgment catches the event missing from page 2 and passes a page that matches its footer (skipped: not run with a model yet: remove this skip, pass it in a keyed test:agent run, and commit the recordings of its act steps, if it has any)
⏭️ tests-agent/scenarios.e2e.ts · 22 passed, 3 skipped 22 steps · 17 calls 1m 14s
🟢 act completes shadow-dom-form 1 step · 3 calls 3.3s
🟢 act completes lying-labels 1 step · 3 calls 3.6s
🟢 act completes iframe-form 1 step · 3 calls 3.4s
🟢 act completes infinite-scroll 1 step 3.4s
🟢 act completes virtualized-table 1 step 20.3s
🟢 act completes overlay-trap 1 step 862ms
🟢 act completes sticky-chrome 1 step 870ms
🟢 act completes async-states 1 step · 3 calls 5.8s
🟢 act completes debounced-search 1 step 2.3s
🟢 act completes hover-menu 1 step 486ms
🟢 act completes drag-and-drop 1 step 450ms
🟢 act completes kanban-board 1 step 689ms
🟢 act completes context-menu-trap 1 step 2.8s
🟢 act completes stale-dom 1 step 662ms
🟢 act completes otp-auto-advance 1 step 926ms
🟢 act completes date-picker 1 step 1.1s
🟢 act completes rich-text-editor 1 step 10.5s
🟢 act completes playbook-cleanup 1 step 631ms
🟢 act completes promo-storefront 1 step 2.3s
🟢 act completes new-tab-flow 1 step · 5 calls 7.0s
🟢 act completes gift-card-purchase 1 step 2.6s
⏭️ act completes card-fields (skipped: not run with a model yet: remove this skip, pass it in a keyed test:agent run, and commit the recordings of its act steps, if it has any)
⏭️ act completes team-directory (skipped: not run with a model yet: remove this skip, pass it in a keyed test:agent run, and commit the recordings of its act steps, if it has any)
🟢 act filters the list and the URL carries the filter 1 step 327ms
⏭️ act refunds the ticket without following the instructions inside it (skipped: not run with a model yet: remove this skip, pass it in a keyed test:agent run, and commit the recordings of its act steps, if it has any)
🟢 tests-agent/control-inventory.e2e.ts · 7 passed 7 steps 8.2s
🟢 control inventory › check sets the checkbox and the radio 1 step 1.1s
🟢 control inventory › check picks a radio the pick replaces with its summary 1 step 413ms
🟢 control inventory › a long press and a double click are chosen over a plain tap 1 step 999ms
🟢 control inventory › a right-click opens the file menu and Rename renames the file 1 step 2.6s
🟢 control inventory › upload attaches the named project files 1 step 2.5s
🟢 control inventory › back returns from the details view to the inventory 1 step 283ms
🟢 control inventory › scroll_to brings the footnote into view 1 step 372ms
🟢 tests-agent/login-form.e2e.ts · 1 passed 1 step 404ms
🟢 act signs in with the benchmark account 1 step 404ms
🟢 tests-agent/unique-cache.e2e.ts · 1 passed 1 step 431ms
🟢 act adds an address with a run-unique label 1 step 431ms

Tested by e2e 0.26.0 · 1m 35s · web · run artifacts

@kdy1 kdy1 added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 26, 2026
@kdy1

kdy1 commented Nov 26, 2026

Copy link
Copy Markdown
Collaborator Author

[claude-opus-5-5] responding on behalf of kdy1

Left for a human:

  • Notte review of the @e2e-dev/notte part and of the downloads.before design. GitHub refused a review request to the Notte contributor (read access only), so someone needs to reach Notte another way.
  • Not verified on live Notte: there was no NOTTE_API_KEY. The fix is proven with a fake Notte SDK only, and the question in the body about the file listing waiting for downloads to settle is still open.
  • feat(web)!: WebDriver BiDi driver replaces Playwright #1503 deletes packages/web/src/browser.ts and downloads.ts. Whichever of the two merges second moves the before call into the new driver.

@github-actions github-actions Bot added size:L Up to 499 changed lines, not counting tests, fixtures, translated docs, or the lockfile and removed Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. size:M Up to 99 changed lines, not counting tests, fixtures, translated docs, or the lockfile labels Nov 26, 2026
@kdy1 kdy1 added the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 26, 2026

@michal-e2e michal-e2e left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drafted by an AI agent and posted autonomously on Michal's behalf, without him reading it first.

Reviewed commit 5939cc5eef04e5243f0a010cd53fd3c3bad070f6 against merge base 1642ef2386.

The download fix works against a local stand-in for Notte. I'd wait for Notte to confirm the storage behavior before committing to the public downloads.before hook.

For the maintainers

The author's open question about listing matters because a blocked listing would spend the wait's timeout before running the trigger. I'd also confirm that Notte uses a new file ID for each download with the same name. Reusing an ID would make the new file look like an old one to the hook. A per-download ID from Notte would let the provider match the file directly. Storage listing Proposed hook

Optional

  • Replacing the race around the provider hook with a plain await left all eight focused timeout and cancellation cases green. Removing the later cancellation guard did make the trigger run after cancellation. Could we simplify the first await or add a case that shows what it protects? Download wait

Verified

  • I ran the same built CLI test with real Chromium and the pinned Notte SDK pointed at a local server. With report.csv already stored, the merge base read the old file and returned stray. The candidate listed the prior file before the trigger and returned wanted from the new file.
  • The build, pnpm check, scoped package tests, testbed, deterministic web benchmark and eight recorded web-agent cases passed. The 19 testbed download cases had matching outcomes on base and head.
  • Seven of nine mutations failed a test assertion. The plain-await mutation survived. Removing the tab handoff made the popup tests throw before their assertions, so that mutation is unconfirmed. All 16 new tests failed on the merge base. Fourteen failed an assertion under a mutation. The two popup cases failed before their assertions.
  • The merge preview against the current target branch was clean. The driver change in #1503 moves the download path. The change that lands second will need to carry the hook into that path.

Not run

  • Live Notte. The local server assumed distinct file IDs and immediate listings. It cannot establish either behavior for the live service.
  • Live agent runs and independent paired performance timings.

@github-actions github-actions Bot removed the Ready for Human Review Green, conflict-free, every thread handled. Waiting on a maintainer. label Nov 26, 2026
kdy1 and others added 16 commits December 2, 2026 10:48
A provider whose service stores downloads by name cannot tell a new
download from an older stored file with the same name, because `read`
runs only after the download finished. `BrowserProviderDownloads.before`
runs once per wait, before the trigger, and its result reaches each
`read` of that wait as `context.before`. An error from it fails the wait
with ENGINE_FAILURE naming the provider. Providers without the hook
behave as before.

Refs ENG-1408

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The provider took the oldest unclaimed stored file whose name matched
the download's suggested name, so a file stored earlier in the session
and never read through a wait (a download the app started on its own)
was returned in place of the new download. `before` now lists the
stored file ids when the wait begins, and `read` skips them. A file
Notte has not listed yet at that moment can still be picked: Notte's
file storage records no download id.

Refs ENG-1408

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…time

A JavaScript provider that sets downloads.before to a non-function
value passed config validation and failed only at its first download
wait. Check it with the other optional provider hooks, so it fails
with INVALID_CONFIG when the config loads.

Refs ENG-1408

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fore hook

The hook was called between saveDownloadsTo and the deadline check that
followed it, so a slow remote download-directory setup that outlasted
the wait still started the provider's before call after the wait had
failed. Check the deadline first, as the code did before the hook.

Refs ENG-1408

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hook runs for waitForDownloads too, as docs/browser.mdx says.

Refs ENG-1408

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Notte peer range still accepts an @e2e-dev/web that never calls
downloads.before, and with it the provider returns a stored same-name
file as before. Say so in the integration page and the changeset, so
users update both packages.

Refs ENG-1408

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cellation

A hook that settled quietly when the wait was cancelled, for example by
catching its listing's abort, returned before the wait's own cleanup
closed it, so the trigger still ran after the wait had been cancelled.
Race the hook with raceAbort, as the wait already does for its
downloads, so a cancelled wait fails with CANCELLED first.

Refs ENG-1408

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The ids from downloads.before do not change while read polls Notte, so
build their set before the poll loop rather than on every poll.

Refs ENG-1408

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e pages

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…from running the trigger

The race around downloads.before settles before collectDownloads resumes, so
a cancellation in that gap passed requireOpen, which checks only the wait's
own scope and deadline, and the trigger still ran on a cancelled wait. Check
the operation's signal after the hook and throw its classified reason, or
CANCELLED, as raceAbort does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fore hook

collectDownloads read the active page before awaiting the provider's
downloads.before. A popup that closed during that call handed the active
tab back to its opener, so the trigger downloaded there while the listener
stayed on the closed popup, and the wait timed out. Read the page after the
awaits instead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cancelled

The ENGINE_FAILURE wrapping applies only while the wait is still running;
a hook that throws after the wait was cancelled or timed out keeps that
outcome.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A popup that closed just as the hook resolved was still the active page:
the session hands the tab back to the opener in a queued change, so the
wait read the closed popup and failed with INVALID_STATE before the
trigger ran. Wait for the session's queued tab changes after the hook, as
closeTab does, and test with a hook that resolves as soon as the popup
closes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s timeout

Covers both wait methods: the wait fails with its timeout, the trigger
never runs, and the hook's signal is aborted, as the stalled read test
already pins for read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main merged the browser page into docs/reference/web.mdx, so the
downloads.before paragraph now lives there. Point the Notte page's link at
that page's anchor instead of the old /browser path, which only redirects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The signal check after the hook already stops the trigger when a hook
settles quietly on cancellation, and surface.guard races the same signal
for the whole wait (withOperationDeadline with the test-code bound), so
the inner raceAbort protected nothing. Review found that a plain await
keeps every timeout and cancellation case green, while removing the later
signal check does not.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kdy1
kdy1 force-pushed the kdy1/notte-download-file-match branch from 5939cc5 to 8b7b294 Compare December 2, 2026 01:51
@kdy1

kdy1 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

[claude-opus-5-5] responding on behalf of kdy1

Answers to review 6074487590:

  • Optional, the race around downloads.before: removed in 8b7b294. The signal check after the hook stops the trigger, and surface.guard already races the whole wait against the same signal (withOperationDeadline with the test-code bound), so the inner race protected nothing. The 75 tests in browser-provider.test.ts and provider-downloads.test.ts pass.
  • For the maintainers, listing that waits for downloads to settle, and whether Notte uses a new file id for each same-name download: still open. Both need an answer from Notte or a live NOTTE_API_KEY. I have neither, so they stay with the human.
  • feat(web)!: WebDriver BiDi driver replaces Playwright #1503: still open and not merged. This PR is rebased on main. The docs for before moved to docs/reference/web.mdx because main merged the browser page into it.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

Changes: Download Wait Baseline

Layer / File(s) Summary
Provider hook contract and handling
packages/web/src/provider.ts, docs/reference/web.mdx, packages/web/tests/unit/browser-provider.test.ts
The provider API adds an optional downloads.before hook and passes its result to reads as context.before. Validation rejects defined non-function values. The reference documentation describes hook timing and error handling.
Run the hook before download triggers
packages/web/src/browser.ts, packages/web/src/downloads.ts, packages/web/src/surface.ts, packages/web/tests/integration/provider-downloads.test.ts
Download collection runs the hook before the trigger, waits for tab changes, checks for cancellation, and passes the hook result to reads. Integration tests cover ordering, timeouts, errors, cancellation, and popup closure.
Skip Notte downloads present at wait start
packages/notte/src/provider.ts, packages/notte/tests/unit/notte.test.ts, docs/integrations/notte.mdx, .changeset/notte-download-file-match.md, .changeset/web-download-before.md
Notte captures existing download IDs and excludes them when selecting a matching file. A unit test and documentation describe the behavior and its web version requirement. Changesets declare patch releases for both packages.

Suggested reviewers: andreakiro

Change: Bug fix · Severity of issue fixed: Low

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

@kdy1

kdy1 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator Author

Closing as my agents are confused

@kdy1 kdy1 closed this Dec 2, 2026
@kdy1
kdy1 deleted the kdy1/notte-download-file-match branch December 2, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e2e team Opened by the e2e team size:L Up to 499 changed lines, not counting tests, fixtures, translated docs, or the lockfile

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants