Skip to content

Open agent browser pages in the background in some conditions#317873

Merged
kycutler merged 3 commits into
mainfrom
kycutler/agentbg
May 21, 2026
Merged

Open agent browser pages in the background in some conditions#317873
kycutler merged 3 commits into
mainfrom
kycutler/agentbg

Conversation

@kycutler
Copy link
Copy Markdown
Contributor

Closes #317869

Copilot AI review requested due to automatic review settings May 21, 2026 22:19
@kycutler kycutler self-assigned this May 21, 2026
@vs-code-engineering
Copy link
Copy Markdown
Contributor

vs-code-engineering Bot commented May 21, 2026

📬 CODENOTIFY

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

@jruales

Matched files:

  • src/vs/workbench/contrib/browserView/electron-browser/browserViewWorkbenchService.ts

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

Adjusts how integrated browser tabs are opened when created by an agent/chat session, so that in some scenarios they open in the background (per #317869) instead of always stealing focus.

Changes:

  • Injects IChatWidgetService and threads IBrowserViewOwner into the editor-opening path to make session-aware decisions.
  • Uses findGroup(...) and checks chat session/widget state to decide whether to open the browser editor tab in the background.
Show a summary per file
File Description
src/vs/workbench/contrib/browserView/electron-browser/browserViewWorkbenchService.ts Adds session-aware logic (via chat widget + editor group resolution) to decide background vs foreground opening for newly created browser views.

Copilot's findings

  • Files reviewed: 1/1 changed files
  • Comments generated: 4

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@kycutler kycutler marked this pull request as draft May 21, 2026 22:34
@kycutler kycutler marked this pull request as ready for review May 21, 2026 22:52
@kycutler kycutler enabled auto-merge (squash) May 21, 2026 23:04
@kycutler kycutler merged commit a74acf0 into main May 21, 2026
25 checks passed
@kycutler kycutler deleted the kycutler/agentbg branch May 21, 2026 23:27
@vs-code-engineering vs-code-engineering Bot added this to the 1.122.0 milestone May 21, 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.

Agent-opened browsers shouldn't always be opened in the foreground

3 participants