Skip to content

Agents web: hide harness picker and host suffix in web when single harness#316144

Merged
osortega merged 4 commits into
mainfrom
osortega/agents-hide-single-harness-web
May 13, 2026
Merged

Agents web: hide harness picker and host suffix in web when single harness#316144
osortega merged 4 commits into
mainfrom
osortega/agents-hide-single-harness-web

Conversation

@osortega
Copy link
Copy Markdown
Contributor

What

In the agents workbench (vscode.dev/agents) the new-chat empty state currently shows:

New session in <repo> with Copilot CLI [<Host>]

This is redundant because:

  • The host is already scoped via the host filter in the title bar — repeating it in the harness label adds noise.
  • When the connected agent host advertises only a single agent (today: just copilotcli), the harness picker has nothing to pick. Surfacing it just invites a click that opens an empty popover.

This PR hides both, scoped to web only. Desktop behavior is unchanged.

How

Two small changes:

  1. SessionTypePicker._updateTriggerLabel — also adds the .hidden class to the trigger when isWeb && allProviderSessionTypes.length <= 1. The existing CSS rule on .session-workspace-picker-with-label:

    .session-workspace-picker-with-label:has(+ .sessions-chat-session-type-picker .action-label.hidden) {
        display: none;
    }

    collapses the dangling "with" connector automatically — no JS coordination required.

  2. RemoteAgentHostSessionsProvider._formatSessionTypeLabel — returns the bare agent label in web (isWebPlatform), instead of `${agentLabel} [${this.label}]`. So labels read "Copilot CLI" instead of "Copilot CLI [My Host]".

Result

Before After
Web, 1 harness New session in <repo> with Copilot CLI [<Host>] New session in <repo>
Web, 2+ harnesses New session in <repo> with Copilot CLI [<Host>] (▾) New session in <repo> with Copilot CLI (▾)
Desktop (unchanged) (unchanged)

Notes

  • Existing tests assert the [My Host] suffix; they run in node so isWeb is false and they continue to pass.
  • The picker hide path uses an existing class hook + CSS :has() rule, so no new selectors or layout work was needed.

In vscode.dev/agents the workbench is already scoped to a single agent
host via the host filter, so:

1. The session-type picker in the new chat view is hidden when there is
   only one harness available (nothing to pick). The existing CSS rule
   on `.session-workspace-picker-with-label` collapses the dangling
   "with" connector automatically via `:has()`.
2. The `[Host]` suffix is dropped from session-type labels, so they
   read e.g. "Copilot CLI" instead of "Copilot CLI [My Host]".

Both behaviors are gated on `isWeb` / `isWebPlatform`; desktop is
unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 12, 2026 23:13
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 reduces UI noise in the Agents (sessions) web workbench by (a) hiding the session-type (harness) picker when there’s nothing to choose and (b) removing the redundant remote host suffix from session-type labels in web, while preserving desktop behavior.

Changes:

  • Hide the session-type picker trigger on web when the connected host advertises 0–1 session types.
  • In web, format remote session-type labels without the [...] host suffix (e.g. “Copilot CLI” instead of “Copilot CLI [Host]”).
Show a summary per file
File Description
src/vs/sessions/contrib/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts Omits host suffix in session-type labels on web via isWebPlatform gating.
src/vs/sessions/contrib/chat/browser/sessionTypePicker.ts Hides the session-type picker trigger on web when there’s only one (or zero) available type.

Copilot's findings

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

osortega and others added 3 commits May 12, 2026 16:40
Browser tests run with isWebPlatform === true by default, so the
existing assertions for 'Copilot [My Host]' need to drop the suffix.
Add an explicit desktop-branch test that overrides isWebPlatform to
preserve coverage for the suffixed label.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The browser test runner runs in electron renderer where isWeb is false,
so the existing 'Copilot [My Host]' assertions were correct. Restore
them and add a separate test that overrides isWebPlatform: true to
cover the web no-suffix branch.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Tests run in both electron renderer (isWeb=false) and playwright
browser (isWeb=true), so assertions that depend on the platform branch
must override isWebPlatform explicitly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 7c143e99 Current: 047126b7

Changed (24)

agentSessionsViewer/CompletedRead/Dark
Before After
before after
agentSessionsViewer/CompletedRead/Light
Before After
before after
agentSessionsViewer/CompletedUnread/Dark
Before After
before after
agentSessionsViewer/CompletedUnread/Light
Before After
before after
agentSessionsViewer/FailedWithDuration/Dark
Before After
before after
agentSessionsViewer/FailedWithDuration/Light
Before After
before after
agentSessionsViewer/FailedWithoutDuration/Dark
Before After
before after
agentSessionsViewer/FailedWithoutDuration/Light
Before After
before after
agentSessionsViewer/WithDiffChanges/Dark
Before After
before after
agentSessionsViewer/WithDiffChanges/Light
Before After
before after
agentSessionsViewer/WithFileChangesList/Dark
Before After
before after
agentSessionsViewer/WithFileChangesList/Light
Before After
before after
agentSessionsViewer/WithBadge/Dark
Before After
before after
agentSessionsViewer/WithBadge/Light
Before After
before after
agentSessionsViewer/WithMarkdownBadge/Dark
Before After
before after
agentSessionsViewer/WithMarkdownBadge/Light
Before After
before after
agentSessionsViewer/WithBadgeAndDiff/Dark
Before After
before after
agentSessionsViewer/WithBadgeAndDiff/Light
Before After
before after
agentSessionsViewer/CloudProvider/Dark
Before After
before after
agentSessionsViewer/CloudProvider/Light
Before After
before after
agentSessionsViewer/BackgroundProvider/Dark
Before After
before after
agentSessionsViewer/BackgroundProvider/Light
Before After
before after
agentSessionsViewer/ClaudeProvider/Dark
Before After
before after
agentSessionsViewer/ClaudeProvider/Light
Before After
before after

@osortega osortega changed the title sessions: hide harness picker and host suffix in web when single harness Agents web: hide harness picker and host suffix in web when single harness May 13, 2026
@osortega osortega marked this pull request as ready for review May 13, 2026 00:22
@osortega osortega enabled auto-merge (squash) May 13, 2026 00:22
@osortega osortega merged commit 5c43f5d into main May 13, 2026
25 checks passed
@osortega osortega deleted the osortega/agents-hide-single-harness-web branch May 13, 2026 00:24
@vs-code-engineering vs-code-engineering Bot added this to the 1.121.0 milestone May 13, 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.

3 participants