Repository navigation
Browser tools: report a dialog that an input action opens after the action resolved - #350301
Draft
Bryan Chen (bryanchen-d) wants to merge 2 commits into
Draft
Bryan Chen (bryanchen-d) wants to merge 2 commits into
Bryan Chen (bryanchen-d) wants to merge 2 commits into
Conversation
Bryan Chen (bryanchen-d)
requested review from
Kyle Cutler (kycutler)
and
a balanced review from Copilot
November 25, 2026 04:45
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Resuming deferred results restarts the frame-settling wait, so a frame that exceeds the polling timeout can cause endless deferrals even after the original callback and wait have completed.
1 open issue
What changed in this PR
This PR addresses #350285 by making browser tool actions report dialogs that open just after the action resolves, rather than leaving the next action blocked unexpectedly.
Changes:
- Adds an optional, cancellable frame-evaluation wait capped at one second and enables it for Playwright tool execution.
- Adds unit coverage for delayed dialogs and actions that open no dialog.
- Temporarily repeats the existing dialog integration scenario 40 times for CI validation.
| File | Description |
|---|---|
src/vs/platform/browserView/test/node/playwrightTab.test.ts |
Tests delayed-dialog reporting and per-frame evaluation. |
src/vs/platform/browserView/node/playwrightTab.ts |
Adds the bounded wait for action-triggered dialogs. |
src/vs/platform/browserView/node/playwrightService.ts |
Enables dialog reporting for tool execution. |
extensions/vscode-api-tests/src/singlefolder-tests/browser.tools.test.ts |
Repeats the dialog scenario for temporary stress validation. |
Review effort: Balanced
Bryan Chen (bryanchen-d)
force-pushed
the
copilot/vscode/browser-dialog-settle
branch
from
November 25, 2026 04:58
0ac327a to
823840e
Compare
Bryan Chen (bryanchen-d)
force-pushed
the
copilot/vscode/browser-dialog-settle
branch
from
November 25, 2026 04:59
823840e to
d6599aa
Compare
…ction resolved A click can resolve before the page runs its handlers, for example before an onclick calls alert(). The tool then reported the click without the dialog, and the agent's next action failed because a dialog was open. After an action run for a tool, wait for one evaluation per frame, capped at 1 s, while still racing the dialog opening, so a dialog the input opened is reported with the action. Evaluations wait for pending dialogs, so the dialog wins that race. Fixes #350285 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…esult Resuming re-runs the stored result through the same path, which restarted the frame wait each time. A frame that answered slower than short resume timeouts could keep returning deferred results after the work finished. The wait already ran, or was cut short by the dialog it reported, on the first call. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bryan Chen (bryanchen-d)
force-pushed
the
copilot/vscode/browser-dialog-settle
branch
from
November 25, 2026 05:03
6a4ecb3 to
873272a
Compare
This branch has not been 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.

Fixes #350285
chat - browser tools › click and typing tools can handle dialogs in main, opaque, and nested frameshas failed intermittently inLinux / Electron (extension host)since #349555. The assertion that fails isclicked.includes('Active alert dialog:'), right afterclick_elementon a button whoseonclickcallsalert(). In each failure the snapshot shows the click landed, because the button or its frame is[active], but the result doesn't report the dialog. See the issue for the failing runs.Cause
PlaywrightTab.safeRunAgainstPageraces the action against a dialog opening. A Playwright click can resolve before the page has run the click's handlers, which means beforealert()is called. The action then completed without a dialog, and the summary was built before the dialog reached the browser view's dialog queue. For an agent, the click looks like it opened nothing, and its next action fails with "Cannot perform action while a dialog is open". This was inferred from the code and the failing outputs. The issue has the full reasoning.Fix
Actions that tools run through
PlaywrightService(invokeFunction,invokeFunctionRaw) now passreportTriggeredDialogs. When an action has completed,safeRunAgainstPagewaits for one evaluation in each frame before reporting the action complete, and it still races the dialog opening:The integration test is unchanged.
Validation
playwrightTab.test.ts:DialogInterruptedError, and it shows up in the summary.'clicked'and makes 0 evaluations.Linux / Electron (extension host). Over two runs it passed 80 of 80, in this run and its rerun. That commit has been dropped.