Skip to content

Leave browsers-pill websites out of the artifacts pill - #332032

Merged
Benjamin Christopher Simmonds (benibenj) merged 2 commits into
mainfrom
agents/artifacts-pill-browser-dedupe
Aug 23, 2026
Merged

Leave browsers-pill websites out of the artifacts pill#332032
Benjamin Christopher Simmonds (benibenj) merged 2 commits into
mainfrom
agents/artifacts-pill-browser-dedupe

Conversation

@benibenj

Copy link
Copy Markdown
Contributor

A page the agent opened in a browser was offered twice in the chat input toolbar: once as a browser entry, and once as a website artifact.

Changes

  • SessionBrowsersControl factors out the owned-browser collection and publishes a new urls observable — the URLs the pill currently lists, empty while the user has the pill hidden (so hiding the pill brings the artifacts back). A set-content equalsFn keeps the frequent title/favicon/loading-state signals from churning downstream.
  • buildSessionArtifactSections takes those URLs and drops Website artifacts pointing at one of them. Matching goes through a normalized key (origin casing, trailing slash), so https://Example.com/docs/ matches a browser on https://example.com/docs. Only websites are filtered — a pull request, issue or commit link stays even if a browser shows it.
  • SessionChatInputToolbar now creates the browsers control (and the pill-visibility state it needs) before SessionArtifacts, which receives this._browsers.urls.
  • Artifact links now open with allowContributedOpeners/fromUserGesture, matching openLinkFromMarkdown. A link behaves the same whether it is clicked in the response text or in the artifacts pill, so a localhost artifact lands in the integrated browser instead of the system one (workbench.browser.openLocalhostLinks defaults to true in the agents window).

Validation

  • Added a filtering test to sessionArtifacts.test.ts and a visible/hidden/disabled URL test to sessionBrowsersControl.test.ts.
  • 25 tests pass across the artifacts, browsers, toolbar and GitHub action suites; tsc --noEmit -p src is clean.

A page the agent opened in a browser showed up twice: once as a browser
entry and once as a website artifact. The browsers control now publishes
the URLs it lists (empty while the user hides the pill), and the artifact
sections drop website artifacts pointing at one of those pages, matched
on a normalized key so origin casing and a trailing slash still match.

Website artifacts also open with contributed openers now, the same way
the link opens from the response markdown it came from, so a localhost
artifact lands in the integrated browser instead of the system one.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Prevents browser-opened pages from appearing twice in the Agents Window toolbar.

Changes:

  • Publishes visible browser URLs and filters matching website artifacts.
  • Aligns artifact link opening with markdown links.
  • Adds browser visibility and URL-normalization tests.
Show a summary per file
File Description
sessionBrowsersControl.test.ts Tests URL publication states.
sessionArtifacts.test.ts Tests website filtering and normalization.
sessionChatInputToolbar.ts Connects browser URLs to artifacts.
sessionBrowsersControl.ts Exposes visible browser URLs reactively.
sessionArtifacts.ts Filters duplicates and updates link opening.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Balanced

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM! Code changes are clean and well-structured.

@benibenj
Benjamin Christopher Simmonds (benibenj) merged commit ab4bd3e into main Aug 23, 2026
29 of 51 checks passed
@benibenj
Benjamin Christopher Simmonds (benibenj) deleted the agents/artifacts-pill-browser-dedupe branch August 23, 2026 06:42
@vs-code-engineering vs-code-engineering Bot added this to the 1.135.0 milestone Aug 23, 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.

4 participants