Repository navigation
Own browser service M2: dialogs, downloads, file chooser, clipboard, logs, viewport, raw CDP (#113) - #126
Merged
Conversation
dialogs.mjs answers the controller's tracked dialog (tab_get_js_dialog, tab_handle_js_dialog: Page.handleJavaScriptDialog in the dialog's frame, settled on javascriptDialogClosed within 60 s). downloads.mjs ports yf and Mf: every attached tab's document responses are paused and released, an unawaited download is failed, playwright_wait_for_download lets the next one through and answers on the host's onDownloadChange (120 s), playwright_download_path answers Chrome's filename, and playwright_locator_download_media's locator half now runs over it. chooser.mjs ports ZO and FO (interception armed within 3 s by default / 120 s max, DOM.setFileInputFiles, OOPIF choosers refused, the file-access sentence naming the cua extension). The inventory's M2 gate turns on with task 2's devlogs.mjs.
…se, document-response interception as the vendor's)
…M2 and traced for M5
…-proof chooser disarm, media setup on the command's deadline, one download per wait A document-response release the service makes on its own is sent again when Chrome refuses it, and when it cannot land the tab's Fetch domain is disabled (Chrome lets paused requests go, probed on headless Chromium) and set up again, or the tab detached; a caller's release (the download wait's) leaves the response to the caller's cleanup. The chooser's disarm, refused while a dialog is open (Chrome answers it only after the dialog closes, probed), goes out when the dialog closes, never while another wait in the tab is armed, and a refused disarm detaches the tab. The media download's interceptor setup carries the command's deadline. Each download-started notification is owned by the earliest waiting match, so two tabs downloading one URL get their own downloads.
…m interception detaches the tab After a successful Fetch.disable, a failure to set document interception up again or to restore the media download's request stage is a failed recovery: the tab is detached, so its next attachment installs interception afresh rather than staying attached with Fetch off.
…nsole logs, backend capability commands, raw CDP gate, cua_move; corpus cases for the document-response pause and the page clipboard
…the host; the blocked navigation's sentence masks its tab id
…he REPL client delivers it (Error: prefix, waiting-on line); the whole-corpus vendor-m2-1 and first cua-m2-1 runs
…ead, 0 unexpected differences across every landed milestone's cases (m2-diff.txt)
…aw CDP's live proof is M4's
… with their own waits (download ownership)
…cted difference (download ownership, a departure in cua's favour), m2-diff.txt
…one non-empty session_id or target_id, refused before the call's policy is chosen
…n the service's own, a failed interceptor removal recovered A request-stage pause is the service's while its request stage is wanted, configured, or of unknown state (a Fetch.enable changing it sent without an answer); any other is a raw CDP caller's and is left to it. Removing a media download's interceptor is sent again on failure within its cleanup budget, then recovered as a release is (Fetch.disable and re-arm, the tab detached as the fallback); a reconfiguration of unknown outcome is always sent again. A failed setup undoes itself on its own budget without holding the caller past its deadline.
This was referenced Oct 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
M2 of the own browser service (#113, child 1 of #114): JS dialog answering, downloads, the file chooser, the clipboard page bridge, console logs, viewport/visibility/management, raw CDP and cua_move. Spec:
docs/doperpowers/specs/2026-10-13-own-browser-service-design.md(Plan of Work M2; execution rulings in its Decision Log and Surprises dated 2026-10-14). The default staysvendor.What changed
dialogs.mjs:tab_get_js_dialog,tab_handle_js_dialogover M1a's tracking (the vendor's refusals and sentences; the answer goes to the dialog's own frame; 60 s close wait). M1a'sdialog_openexpected difference is now exercised end to end.downloads.mjs: Fetch interception of document responses on every attached tab (vendor parity) with bounded release recovery (retry, thenFetch.disable+ re-arm, detach as fallback);playwright_wait_for_download(120 s),playwright_download_path,download_media's result; each download-started notification owned by one wait (fixes the vendor's same-URL defect); request-stage pauses released only when the service's own; nothing logs file contents, full URLs, paths or bookmarks.chooser.mjs: interception armed per wait (3 s default, 120 s max), disarmed even when a dialog blocks the cleanup (deferred until it closes),DOM.setFileInputFiles; OOPIF choosers unsupported with the vendor's sentence.clipboard-bridge.mjsandtab_clipboard_*over the virtual clipboard;devlogs.mjs(tab_dev_logs);viewport.mjs(viewport, visibility, management through the host'sexecuteUnhandledCommand);rawcdp.mjs(tab_cdp_*only when the backend announcescdp, a supplied target validated as the vendor's);cua_move.downloads/two-tabsas a departure in cua's favour; a host-trace test proving eachFetch.requestPausedand release is recorded for M5's attribution.Validation Evidence
HOME=/tmp/cua-scratch-home npm test→# pass 1581,# fail 0,# skipped 8;npm run test:mods→32 pass;claude plugin validate .→✔ Validation passed with warnings(the known warning).ssfs),docs/evidence/2026-10-13-own-browser-service-parity/m2-diff.txt:vendor-m2-1(56/56 cases ok) vscua-m2-2over every landed milestone's cases →0 unexpected differences (51 cases, 139 cells, 12 expected)5 unexpected differences (56 cases, 144 cells, 12 expected): exactly the M3 cases cua does not serve yet (export rejections, history)downloads/two-tabs→0 unexpected differences (1 cases, 2 cells, 1 expected)(vendor: one download reaches both waits; cua: two)getJsDialogreports the alert, a locator action fails withdialog_open,handleJsDialogclears it; a download resolves to a file under Chrome's download directory; a file input acceptssetFiles.doperpowers:reviewer-high: two P2 (raw callers' request-stage pauses consumed by the service; a failed media-interceptor removal not recovered), fixed in a0e50be; final verdict "correct", no material findings.Residue