Browser: preparation for tools - #296657
Merged
Merged
Conversation
Kyle Cutler (kycutler)
requested review from
Copilot and
Joaquín Ruales (jruales)
February 20, 2026 23:55
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prepares the integrated browser for “tools” by introducing a shared-process Playwright automation service, wiring browser views into page tracking (“shared with agent”), and tightening CDP/session cleanup.
Changes:
- Expanded
IPlaywrightServicefrom a TODO stub into a concrete automation + page-tracking API (summary, screenshots, dialog/file chooser handling, arbitrary function invocation). - Added “tracked/shared with agent” state to
BrowserViewModel, backed by Playwright page tracking and an update event. - Improved lifecycle handling in CDP/browser-view group code (session disposal on target removal; context bookkeeping on view removal), and updated Playwright dependency.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/workbench/contrib/browserView/common/browserView.ts | Adds sharedWithAgent state + event, and routes share/unshare via IPlaywrightService. |
| src/vs/platform/browserView/node/playwrightTab.ts | New Playwright page wrapper for summaries, logs, and dialog/file chooser state. |
| src/vs/platform/browserView/node/playwrightService.ts | Implements shared-process Playwright service, tracking, lazy init, page manager, screenshots, summaries, and function invocation. |
| src/vs/platform/browserView/electron-main/browserViewGroup.ts | Updates context bookkeeping when views are removed from a group. |
| src/vs/platform/browserView/common/playwrightService.ts | Defines the new IPlaywrightService API contract (tracking + automation). |
| src/vs/platform/browserView/common/cdp/proxy.ts | Disposes sessions when a target is unregistered to avoid stale sessions. |
| package.json | Pins playwright-core to an alpha build. |
| package-lock.json | Lockfile updates to reflect the Playwright dependency change. |
Contributor
|
Overview of changes in the first commit (828c530) of this PR graph TD
subgraph Workbench
BVM["BrowserViewModel<br/>sharedWithAgent toggle"]
end
subgraph Shared Process
PS["PlaywrightService<br/>lazy init + API facade"]
PM["PlaywrightPageManager<br/>tracking + FIFO matching"]
PT["PlaywrightTab<br/>dialog/log/summary per page"]
PW["Playwright-core<br/>(browser automation)"]
end
subgraph Electron Main
BVG["BrowserViewGroup<br/>context bookkeeping fix"]
CDP["CDPBrowserProxy<br/>session cleanup fix"]
end
subgraph Browser
Pages["Browser Pages"]
end
BVM -->|"start/stopTrackingPage"| PS
PS -->|"delegates tracking"| PM
PS -->|"lazy init: createGroup + connectOverCDP"| BVG
PM -->|"FIFO pairs viewId ↔ Playwright page"| PW
PW -->|"controls"| Pages
PM -->|"wraps each page"| PT
BVG -->|"CDP WebSocket"| CDP
CDP -->|"session lifecycle"| Pages
PS -.->|"onDidChangeTrackedPages"| BVM
|
Kyle Cutler (kycutler)
enabled auto-merge (squash)
February 23, 2026 00:33
Dmitriy Vasyura (dmitrivMS)
approved these changes
Feb 23, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.