Skip to content

fix(browser): deliver agent clicks and keys to pages that loaded while their pane was hidden - #34291

Merged
AmoabaKelvin merged 1 commit into
mainfrom
hidden-browser-pane-click-lost
Oct 27, 2026
Merged

AmoabaKelvin merged 1 commit into
mainfrom
hidden-browser-pane-click-lost

Conversation

@AmoabaKelvin

@AmoabaKelvin AmoabaKelvin commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​66 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​65
Prod 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​99 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​91

When an agent loaded a page in a browser tab hidden behind another tab, orca click, hover, keypress and mouse on that page reported success after a ~5 s stall, and the page got no press and no key. In a hidden dev build on main, a click after goto in a parked tab took 5.35 s and the page saw only mouseover. keypress and type were lost too. With this change the same click takes ~0.3 s and delivers mousedown, mouseup and click, and keys and typing arrive.

A document that loads while its pane is parked (display: none) never paints. Chromium drops input to a document before its first paint, and it holds mouse moves for a frame that never comes. A page that painted before it was parked takes input normally.

Before agent input reaches a webview guest, Orca now asks the page whether it has painted. If it hasn't, the existing capture paint hold keeps the pane drawn until a paint entry appears or a few frames pass, then lets go. This happens once per document, in the CDP proxy's input queue and in the bridge's direct pointer and key commands, so every input route goes through it. A painted page costs one fast probe.

The hold ends at the first paint instead of wrapping each input, because every release re-throttles the whole Orca window.

Known limit: a document that never paints anything (an empty body) can still lose its very first key while Chromium holds back its first commit.

Supersedes #27310 by @outof-place, which found the same cause and the paint-entry wait. That branch sits on an older agent-browser bump, the proxy it changed has since been restructured, and it leaves keys out. This version works on the current input queue and also covers keys and the bridge's own mouse commands. #29161 (scripts waiting on frames) is a separate case and stays as it is.

Fixes #27309

…e their pane was hidden

A page that loads while its browser pane is parked (display:none) never
paints, and Chromium drops input to a document before its first paint.
orca click/hover/keypress/mouse on such a page reported success after a
~5 s mouseMoved stall while the page got no press or key.

Before agent input reaches a webview guest, from the CDP proxy queue or
the bridge's direct pointer and key routes, ask the page whether it has
painted. If not, hold its paint with the existing capture paint hold
until a paint entry appears or a few frames pass, once per document.

Co-authored-by: outof-place <contact@outofplace.space>
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 899bd434-b96e-49aa-a0c7-8330b284edf5
Commits

Reviewing files that changed from the base of the PR and between b29ae01 and 1c69351.

Files selected for processing: 10
  • src/main/browser/agent-browser-bridge-host-revocation.test.ts
  • src/main/browser/agent-browser-bridge-interaction-commands.ts
  • src/main/browser/agent-browser-bridge-mouse-commands.ts
  • src/main/browser/agent-browser-bridge-pointer-commands.ts
  • src/main/browser/cdp-page-input-commands.ts
  • src/main/browser/cdp-screenshot.ts
  • src/main/browser/cdp-ws-proxy-first-paint.test.ts
  • src/main/browser/cdp-ws-proxy-test-harness.ts
  • src/main/browser/cdp-ws-proxy.ts
  • src/main/browser/guest-first-paint.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@AmoabaKelvin
AmoabaKelvin merged commit 8655ce6 into main Oct 27, 2026
33 checks passed
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.

Agent browser: a click after goto in a parked tab takes ~5 s and can return ok without clicking

1 participant