Skip to content

Preserve agent-browser configuration during viewport setup and stream discovery - #1304

Merged
nedtwigg merged 2 commits into
mainfrom
audit-browser-preflight-options
Oct 21, 2026
Merged

nedtwigg merged 2 commits into
mainfrom
audit-browser-preflight-options

Conversation

@nedtwigg

Copy link
Copy Markdown
Member

Opening a fresh agent-browser pane with --config or other launch options could fail during viewport preparation, or navigate successfully and then replace the browser while discovering its stream. The internal DPR, viewport, and stream-status calls dropped the options supplied to the destination command; agent-browser can relaunch when those options change.

Carry the same launch configuration through those internal calls. Keep output-control flags on the original command so quiet output cannot hide the DPR response. Update the browser contract and evidence.

Validation: two new viewport regressions fail before the fix; 21 viewport tests pass, including stream discovery after non-navigation commands. Full CLI suite: 261 pass, 14 skipped, one previously reproduced Windows filename-fixture failure. Build, spec, Markdown, and diff checks pass. Live standalone harness reproduced the failure with a temporary config; the fixed Windows browser pane renders a test page whose first script records 1440 x 900 at DPR 1.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 10167f5
Status: ✅  Deploy successful!
Preview URL: https://e73e70b3.mouseterm.pages.dev
Branch Preview URL: https://audit-browser-preflight-opti.mouseterm.pages.dev

View logs

@dormouse-bot dormouse-bot 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.

AGENT_BROWSER_LAUNCH_FLAGS matches the relaunch hash in agent-browser 0.27.0, but current releases hash two more flags that Dormouse already parses: --hide-scrollbars and --allowed-domains (launch_hash in v0.39.1). On 0.39, open <url> --profile /tmp/p --allowed-domains example.com now sends --profile without the domain list on the DPR and viewport calls. That makes those calls send a launch whose hash differs from the blank page's, so the browser relaunches. The final open carries both flags and relaunches again, and the destination loads without the prepared viewport. Before this PR those internal calls sent no launch at all for this command, so the combination is a new regression. Adding both flags (and one of them to the new test's flag lists) closes the gap.

Comment thread dor/src/commands/browser-cli.ts Outdated
@nedtwigg
nedtwigg added this pull request to stack #1330 October 21, 2026 17:03
@nedtwigg
nedtwigg merged commit ba65738 into main Oct 21, 2026
14 checks passed
@nedtwigg
nedtwigg deleted the audit-browser-preflight-options branch October 21, 2026 17:08

This branch was successfully deployed

No deployments
hosted-preview — 10167f58 Deployed Oct 21, 2026 by nedtwigg via cleanup #1863
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants