Repository navigation
fix(desktop): stop the blank initialize load from aborting browser.open_url - #4331
Conversation
…en_url Since the built-in browser started loading about:blank on tab creation to preempt persistent-session restore, the agent-facing `browser.open_url` action has rejected every request with `ERR_ABORTED (-3) loading 'about:blank'`: the queued blank navigation aborts the CDP marker load that `openBrowserUrlForAutomation` awaits right after creating the tab, so the tool never returned a target and the page never opened. Let callers that load their own page synchronously opt out of the blank initialize load. The automation path does so; the marker page it loads immediately already preempts session restore, and other tab creation paths keep their blank load because their first navigation is queued the same way. Adds `browser-open-url-returns-target.e2e.test.ts` under a new `desktop.builtin-browser` contract: the action resolves with a handle, the tab loads the page, the returned CDP target answers for that page, and a second request opens a second tab. The same spec fails on current `dev` with the abort above.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Test evidence — browser-open-url-opens-the-page-and-hands-the-agent-a-live-cdp-target-for-it — 0/0 screenshots passed · 4 assertions✅ 0/0 screenshots passed · 4 assertions · 4 expectations passed · 0 failed · 0 pending
ℹ️ ASSERTION — 1. browser.open_url resolves with a built-in browser handleThe control action returned provider builtin, tab tab_mtkhrzzq_1, and CDP target 2C83295256C2A629C2870F5F8A57CE7A for http://127.0.0.1:32981/health?first.
ℹ️ ASSERTION — 2. The new tab loads the requested pageTab tab_mtkhrzzq_1 reports url http://127.0.0.1:32981/health?first with status ready.
ℹ️ ASSERTION — 3. The returned CDP target is the loaded pageTarget 2C83295256C2A629C2870F5F8A57CE7A answered Runtime.evaluate with location http://127.0.0.1:32981/health?first and a body containing "ok":true.
ℹ️ ASSERTION — 4. A second browser.open_url opens a second, independent tabTab tab_mtkhs1gi_2 (target F03C1F6DFCDEC1233FB3398C10BC27BE) loaded http://127.0.0.1:32981/health?second while tab tab_mtkhrzzq_1 stayed separate.
Test run created 2026-09-02T19:29:50.860Z · Source: |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (08e83debf14e172e203d28cb5b999d3f8c335810). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Problem
Since #4207 started loading
about:blankon every new built-in browser tab (to preempt persistent-session restore), the agent-facingbrowser.open_urlaction has rejected every request with:openBrowserUrlForAutomationcreates the tab and immediately awaits the CDP marker-page load. The blank initialize load is queued as a detached task, so it starts after the marker load and aborts it; Electron'sloadURLpromise rejects with the aborting navigation's URL, the IPC call fails, and the tool never returns a target or opens the page. Every agent browser session that begins withbrowser.open_urlhas been failing ondevfor a week.Reproduced on clean
dev@e0ce31da9: the spec added here fails there with exactly that error (pnpm evals:e2e browser-open-url-returns-target, exit 1, 0 passed / 1 failed).Change
createBrowserTab(url, { select, initializeBlank = true }): callers that load their own page synchronously can opt out of the blank initialize load.openBrowserUrlForAutomationpassesinitializeBlank: false. The marker page it loads right away already preempts session restore, so nothing is lost.Verification
Runtime proof —
evals/specs/browser-open-url-returns-target.e2e.test.ts, mapped to a newdesktop.builtin-browsercontract (browser-panel.mjs,browser-content-preload.cjs). It drives the real control action against the desktop's own local server page (/health, no token, loopback), so nothing depends on the public internet. Claims: the action resolves with a built-in handle; the tab loads the requested page; the returned CDP target answersRuntime.evaluatefor that page; a second request opens a second, independent tab.Daytona lane, exact head
08e83debf:Negative control, identical spec on clean
dev@e0ce31da9, local: exit 1,ERR_ABORTED (-3) loading 'about:blank'. The spec also passes locally on this branch (1/0/0).Also green on this head:
Verdict: Passed.
Related