Repository navigation
Conversation
Every coordinate input from the phone (tap, move, wheel, key) took an automation-visibility lease first. The lease runs script in the desktop renderer and waits for two animation frames, capped at 2s. When the desktop window is minimized, occluded or otherwise throttled, those frames never come, so each input stalled the full 2s before dispatching — and inputs are serialized per page, so a scroll (move + wheel) cost 4s. A page with a live screencast is already kept paintable for its remote viewer (browser-page-paintability's hasRemoteViewer term), so the lease buys nothing there. The screencast stream now marks its guest as streaming for the life of the stream, and the bridge skips the lease for a streaming guest. Measured on a background dev build with the desktop renderer frozen via CDP Page.setWebLifecycleState: lease 2001ms, dispatch 0-1ms per input.
This was referenced Sep 23, 2026
Merged
Contributor
Author
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.
ELI5
When you use a browser tab from the Orca phone app, every tap, scroll or key press first asked the desktop app to "get the page ready to be seen" and waited for the desktop window to draw twice. If the desktop window was minimized or hidden behind other windows, it never draws, so every tap waited 2 seconds before happening. The phone is already watching that page, which keeps it ready, so the wait is skipped now.
What Changed
executeWithVisibleTarget(agent-browser bridge queue) takes an automation-visibility lease before each targeted command. That lease runs script in the desktop renderer and waits on tworequestAnimationFrames, capped at 2s (waitForAutomationVisiblePaint). A throttled window never firesrequestAnimationFrame. The screencast stream now marks its guest as streaming for the life of the stream (browser-screencast-streaming-guests.ts), and the queue skips the lease for a guest that is streaming.Why
A page with a remote viewer is already kept paintable.
isBrowserPagePanePaintableincludes ahasRemoteViewerterm for this reason, so while the stream runs, the lease is redundant. Alternatives considered:Commands without a screencast, such as agent CLI automation, keep the lease unchanged.
No wire change; host-only, so mixed client/host versions are unaffected. Works the same for SSH-backed worktrees (the browser always runs on the desktop host).
Linked Issue
STA-8024 (Linear). Related: STA-4128, STA-7002.
Visual Proof
N/A: input timing on the host, with no UI change. Timings are below.
Testing
Timed on a background (
ORCA_BACKGROUND_LAUNCH=1) dev build on macOS. Each run tookorca mouse moveagainst a local test page with temporary timing logs inexecuteWithVisibleTarget:requestAnimationFramerunning)requestAnimationFrame(renderer frozen via CDPPage.setWebLifecycleState, standing in for minimized/occluded)The frozen renderer stands in for a minimized window: it stops the renderer the same way, but it isn't the real macOS occlusion path. I didn't minimize a visible window, because doing that from automation would take focus.
agent-browser-bridge-streaming-input.test.ts: move, wheel and click on a streaming guest take no lease, and the lease comes back once the last stream ends. It fails without the fix.browser-screencast-lifecycle.test.ts: the guest is marked streaming for exactly the life of the stream.pnpm tc:node, targetedsrc/main/browsersuites,pnpm run check:code-quality:changed.AI Disclosure
Claude (Opus).
Notes
A companion mobile PR fixes the other two freeze and tap causes on the phone side (frame pacing, double taps).
Checklist
pnpm lint,pnpm typecheck,pnpm test,pnpm build(targeted locally; CI will cover the rest)