Repository navigation
fix(desktop-browser): wait for the first page before the action records page state, inside its cancellation - #10384
Merged
waleedlatif1 merged 2 commits intoNov 24, 2026
Conversation
…ds page state, inside its cancellation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
[Medium impact] The PR appears safe to merge. SummaryMoves the first-page wait before page state is recorded and makes cancellation stop the wait.
Reviews (2) · Last reviewed commit: "fix(desktop-browser): drop the uncancell..." · Reviewed by Greptile |
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Turn on auto-fix | Re-trigger cubic
Collaborator
Author
Collaborator
Author
|
@cubic-dev-ai review this PR |
Contributor
@waleedlatif1 I have started the AI code review. It will take a few minutes to complete. |
This branch was previously deployed
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.
Summary
Follow-up to #10382, which merged before its review round was addressed. Its first-page wait sat inside
execInPage, below where tools record page state and check cancellation, which left two bugs (both flagged in #10382's review):captureSnapshotrecords the page's navigation and capture counters before callingexecInPage, so the first page committing during the wait changed them and the finished snapshot was rejected as "The tab changed while its snapshot was being captured"browser_scrollcancelled mid-wait ran on the page once it loaded, possibly alongside newer browser workThis moves the wait into
executeTool, before the execution epoch and any page state are taken:BROWSER_TOOL_USES_PAGE, exhaustive overBrowserToolNameso a new tool must choose); navigation and tab management never wait on a loading popupwaitForLoadCompletetakes the execution's abort signal; the wait is raced with the cancellation promise (so its rejection is always observed) and re-checks the abort afterwards, since a cancel aborts the signal before rejectingyieldToUser: half the tool's watchdog, at most the navigation timeoutexecInPageis back to its exact pre-fix(desktop-browser): wait for a new tab's first page before calling it blank #10382 form: a page that outlasts the bounded wait is refused as blank right away, with no second, uncancellable waitType of Change
Testing
driver.test.ts, "a tab still loading its first page":did-navigate+did-stop-loading). Fails on the pre-fix(desktop-browser): wait for a new tab's first page before calling it blank #10382 driver (blank-tab error) and on fix(desktop-browser): wait for a new tab's first page before calling it blank #10382's version (tab-changed error)execInPagewait remainsapps/desktop/src/main/browser-agentsuite (562 tests, no unhandled rejections), desktoptype-check, biomebrowser-focus.spec.tsin CIChecklist
test-auditauthoring gate)