Repository navigation
fix(browser): a popup a click opens runs at once, and the recording's video stays on it - #722
Merged
earakely-scale merged 2 commits intoNov 16, 2026
Conversation
… on it The browser log tells a recording of an action when the browser answers it, and the browser opens the popup a click makes before it answers the click, so the click could take the video back to its opener, where it stayed until the agent's next action in the popup. An action begun on a tab before a tab it opened, which the video has followed since, now leaves the video there; one begun on the opener after that still takes it back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BrowserControl held each page it attached to until it had enabled it and set its viewport, and only then told it to run. Chromium answers Page.enable on a popup a click opened, paused before its first navigation, only once it runs, so the control waited out Page.enable's 30 s timeout first: on the released Chromium with a viewport, every popup showed its page 30 s after the click, unless another client let it run. The calls now go together, in the order the browser handles them, so the viewport still applies before the page runs: 0.05-0.08 s on the same Chromium. A browser recording followed the popup blank meanwhile. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
deleted the
edgararakelyan/fd-5973-m822-follow-up-a-click-that-opens-a
branch
November 16, 2026 23:43
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.
What and why
FD-5973, a follow-up of M8.22 (FD-4970). Two bugs on the path a popup takes, both found through flakes of
test_each_context_is_recorded_alone_its_video_following_its_agent_while_agents_act_on_all_at_once.BrowserControlholds each page it attaches to until it has enabled it and set its viewport, and only then tells it to run. Chromium answersPage.enableon a popup a click opened, paused before its first navigation, only once it runs. So the control waited out the call's 30 s timeout before letting the popup run. This applies to a browser with a viewport, which a chromium computer is. Unless another CDP client resumed the popup first, the agent waited 30 s for it too. That's likely why the test usually passed: the agent's Playwright connection resumes the popup itself.BrowserLog.finish), and the popup opens before the click is answered. So the click's answer could take the video back to the opener.The CI runs show both. On #717 the video followed red, orange, red, orange, red, with the agent's next popup action 30 s later. On this PR's first commit, the video stayed on the popup but was blank for 30 s, because the popup hadn't run.
What changes
website_browser/control.py,_let_run:Page.enable, the viewport and file-chooser calls, andRuntime.runIfWaitingForDebuggernow go together, in order, and the control waits for them all. The browser handles a session's commands in order, so the viewport still applies before the page runs. A call that fails is still raised after the page is told to run, as before.website_browser/stream.py: when the video follows a popup, it notes the log's next sequence number for the opener. An action on the opener numbered below that began before the popup opened, and leaves the video on the popup. One begun after it still takes the video back.recording.pypasses the numbers.How it was tested
Real Chromium, on an agent-environments-admin VM (amd64), using the Chromium in v0.9.1546's released
agentenv-chromiumimage, pulled anonymously. It ran headful on Xvfb with agentenv's flags over--remote-debugging-pipe, with a 1280×800 viewport:A CDP-level run showed the cause. Awaiting
Page.enablebefore resuming, the popup'sPage.enablenever answered within 10 s, and nothing navigated or painted. Sending the three calls together, all answered in about 3 ms, the popup loaded in about 6 ms, and a screencast started at 0 or 100 ms sent orange frames.Unit:
test_a_popup_that_answers_page_enable_only_once_it_runs_is_told_to_run_at_once_held_to_its_window_firstmodels that browser and times out on main.test_a_click_that_opens_a_popup_leaves_the_video_on_it_though_the_click_is_answered_afterfails on main with['T3', 'T4', 'T3'].Integration:
integration-local-slowin CI.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no blocking issues were found.Summary
This PR removes the popup startup wait and keeps its recording from jumping back to the opener.
No actionable new issues were found in the changes since the previous review. The full PR also passed the repository-rule check. Tests were inspected, not run.
Reviews (5) · Last reviewed commit: "fix(browser): a popup a click opens runs..." · Reviewed by Greptile