Skip to content

fix(browser-recording): a frame waits out a page that's busy or between documents - #643

Merged
earakely-scale merged 2 commits into
mainfrom
edgararakelyan/browser-frames-survive-busy-pages
Nov 12, 2026
Merged

earakely-scale merged 2 commits into
mainfrom
edgararakelyan/browser-frames-survive-busy-pages

Conversation

@earakely-scale

@earakely-scale earakely-scale commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

A follow-up to #633 (M8.23, FD-4971): a frame now waits out a page that's too busy to paint, or between documents mid-navigation, instead of going missing.

Online-Mind2Web's first sample eval lost frames on its Target task. Both arms lost 3 each while target.com's pages loaded, and each missing frame failed its run as an infrastructure failure, as it should. The captures failed in two ways:

At 300 tasks, many on heavy sites, this would fail a lot of runs.

What changes

BrowserControl.frame (website_browser/control.py)

  • Longer budget: a frame has FRAME_CAPTURE_S, 10 s, to show, rather than a screenshot's 3 s. A frame is taken in the background, after a burst of actions settles, so nothing waits on it the way an agent waits on a screenshot.
  • Retries between documents: a capture the browser refuses that way (BETWEEN_DOCUMENTS) is asked again every 0.25 s within that budget. It's asked of the active tab if the tab closed meanwhile.
  • Still strict: any other refusal, or a frame still not shown after the budget, is missing as before. The run still fails, and the tab is never brought to the front.
  • Dialogs: each attempt checks for a dialog first. A tab a dialog keeps from painting gives the frame it last took, including when a retry switched to it because the first tab closed.

How long a recording's calls take (website_browser/recording.py, task_steps/browser/recording.py)

  • The extension names how long a start takes, its first frame taken and uploaded (START_S). It also names how long an end takes (END_S): a frame still in flight, its last two frames, the wait for its log, and the log's and the manifest's uploads.
  • Each upload counts at the transfer helpers' own TRANSFER_STALL_BUDGET_SECONDS, the longest they take to give up on an upload whose connections all stall. That makes the bounds 318 s and 1,450 s at worst; a normal end answers in seconds.
  • start_browser_recording and end_browser_recording wait that long. Before, they used the 30 s default, which an end's last two frames could now outlast. Teardown's end_all for a browser waits as long too.

Test plan

  • Unit, the SDK (test_browser_recording.py):
    • A frame refused twice between documents is asked again and taken.
    • A frame refused for another reason is missing at once, after one capture.
    • A page busy for less than the frame budget is framed; one busy for longer is missing, naming the budget.
    • A tab that closes while its frame is asked again is framed as the active tab, which a dialog holds, from the frame it last took.
  • Unit, the steps (browser_recording_test.py): the start and end calls wait START_S and END_S.
  • Results: the protocol package and tst/unit/task_step, providers and task: 6,542 passed, 8 skipped.
  • Real runs, local Docker (Mac, arm64), Online-Mind2Web's Target task on both arms, Claude Haiku 5.5:
    • Before the fix: 3 of 49 frames missing on tools, 3 of 28 on cdp.
    • With it: 18 and 16 frames, none missing, on the same target.com and Target careers pages.
    • Both runs exported to the benchmark's v2 format and were graded by WebJudge on GPT-6 Luna: tools success, cdp failure (it didn't apply the job-category filter).
    • One caveat: a manifest doesn't record retries, so these runs don't show directly that a retry fired. They show the frames are no longer lost.

Docs

The user guide's browser recording section should say that a frame waits up to 10 s for a page that's loading or busy, and how long a start and an end take.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Browser recordings give busy pages more time to paint and retry captures refused during navigation.

  • Recorded frames wait out busy pages and document swaps.
  • Recording calls wait long enough for their frames and uploads.

Reviews (6) · Last reviewed commit: "fix(browser-recording): bound a start an..." · Reviewed by Greptile

…en documents

On a heavy site (Online-Mind2Web's Target task), both arms lost 3 frames each
while pages loaded:
- "Page.captureScreenshot: Not attached to an active page", while a navigation
  swaps the tab's document
- "the tab painted nothing within 3 s", a page too busy to paint

Each missing frame failed its run as an infrastructure failure.

A frame now has FRAME_CAPTURE_S (10 s) to show, rather than a screenshot's 3 s,
since it's taken in the background. A capture refused between documents is
asked again every 0.25 s within that budget. Any other refusal, or a frame still
not shown after it, is missing as before.

The extension now names how long a start and an end may take (START_S, END_S),
and the steps wait that long, not the 30 s default an end's last two frames
could now outlast.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale requested a review from a team as a code owner November 12, 2026 19:20
…wait on, and recheck a dialog after a retry

- START_S and END_S count every upload a start or an end waits on (a frame in
  flight, the last two frames, the log and the manifest) at the transfer
  helpers' own stall budget, plus a reply's margin, instead of a made-up 30 s.
  Teardown's end_all for a browser waits as long.
- A frame retried after its tab closed meanwhile rechecks the replacement tab's
  dialog, so a tab a dialog holds gives the frame it last took instead of a
  capture that can't paint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@earakely-scale
earakely-scale merged commit f955962 into main Nov 12, 2026
65 of 67 checks passed
@earakely-scale
earakely-scale deleted the edgararakelyan/browser-frames-survive-busy-pages branch November 12, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant