Skip to content

Better browser open tool responses#308328

Merged
kycutler merged 1 commit intomainfrom
kycutler/toolsfixes
Apr 7, 2026
Merged

Better browser open tool responses#308328
kycutler merged 1 commit intomainfrom
kycutler/toolsfixes

Conversation

@kycutler
Copy link
Copy Markdown
Contributor

@kycutler kycutler commented Apr 7, 2026

Fixes #306971

Copilot AI review requested due to automatic review settings April 7, 2026 21:22
@kycutler kycutler self-assigned this Apr 7, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves integrated browser tool behavior by returning richer “already open” results and by formatting tracked browser page context consistently, helping discourage agents from opening redundant browser tabs (fixes #306971).

Changes:

  • Replace single-page “already open” responses with a multi-page summary result (getExistingPagesResult) and shared formatting (formatBrowserEditorList).
  • Update the browser pages chat context publisher to use the shared formatter.
  • Improve Playwright tab snapshot/reporting and request-finish waiting behavior.
Show a summary per file
File Description
src/vs/workbench/contrib/browserView/electron-browser/tools/openBrowserToolNonAgentic.ts Reuses new existing-pages result helper for non-agentic open behavior.
src/vs/workbench/contrib/browserView/electron-browser/tools/openBrowserTool.ts Reuses new existing-pages result helper for agentic open behavior.
src/vs/workbench/contrib/browserView/electron-browser/tools/browserTools.contribution.ts Uses shared formatter to publish tracked browser pages into chat context.
src/vs/workbench/contrib/browserView/electron-browser/tools/browserToolHelpers.ts Introduces shared formatting + multi-page existing-pages detection/result building.
src/vs/platform/browserView/node/playwrightTab.ts Fixes snapshot availability check and uses cancelable timeout race for request completion waits.

Copilot's findings

  • Files reviewed: 5/5 changed files
  • Comments generated: 3

@kycutler kycutler marked this pull request as ready for review April 7, 2026 21:32
@vs-code-engineering
Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@jruales

Matched files:

  • src/vs/platform/browserView/node/playwrightTab.ts
  • src/vs/workbench/contrib/browserView/electron-browser/tools/browserToolHelpers.ts
  • src/vs/workbench/contrib/browserView/electron-browser/tools/browserTools.contribution.ts
  • src/vs/workbench/contrib/browserView/electron-browser/tools/openBrowserTool.ts
  • src/vs/workbench/contrib/browserView/electron-browser/tools/openBrowserToolNonAgentic.ts

@kycutler kycutler enabled auto-merge (squash) April 7, 2026 21:56
@kycutler kycutler merged commit 185149b into main Apr 7, 2026
27 checks passed
@kycutler kycutler deleted the kycutler/toolsfixes branch April 7, 2026 21:57
@vs-code-engineering vs-code-engineering bot added this to the 1.116.0 milestone Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Discourage agents from opening new tabs when there are others to use

3 participants