sessions: Add Remotes management to Customizations by chrmarti · Pull Request #343167 · microsoft/vscode · GitHub
Skip to content

sessions: Add Remotes management to Customizations - #343167

Draft
Christof Marti (chrmarti) wants to merge 3 commits into
mainfrom
chrmarti/remotes-customizations
Draft

Christof Marti (chrmarti) wants to merge 3 commits into
mainfrom
chrmarti/remotes-customizations

Conversation

@chrmarti

Copy link
Copy Markdown
Collaborator

Summary

Adds a desktop Agents-window Remotes page to Customizations so users can manage which known remote locations appear in the New Session picker without going through separate connection pickers.

  • Adds entry points in both the Customizations dialog and the sidebar below the Sessions list, with a shared live badge counting enabled remotes.
  • Reuses the Plugins tree/group-header/switch controls and standard page insets. Groups are WSL (Windows only), SSH, Tunnels, and Dev Containers.
  • Combines SSH configuration, installed WSL distributions, account tunnels, local Docker Dev Containers, and already registered locations. Refresh failures are shown as warning icons on the affected group, with simple tooltips and diagnostic details in the Window log.
  • Uses existing registration/removal mechanisms and leaves the location-picker implementation unchanged. Adds registration-only APIs for WSL and Dev Container workspaces, and ensures offline SSH/WSL registrations publish their providers.
  • Includes keyboard navigation, accessibility help and an accessible view, discovery cancellation, focused regression tests, and themed fixtures.

No linked issue; this draft is a prototype requested directly during development.

Behavior and limitations

  • Switching on registers the location without explicitly connecting. Existing automatic-connection settings still apply.
  • Switching off may disconnect/remove the provider. Dev Container removal here forgets the location; it does not delete the container.
  • Local Dev Container discovery uses desktop IPC, not a new Agent Host Protocol requirement. Containers without a local source folder are shown with disabled switches.
  • Badge counts come from registered enabled locations, independently of search filtering or connection status; zero-count badges are hidden.
  • Live WSL and authenticated tunnel flows have not been exercised. Docker enumeration and registration are covered by tests, but live Docker discovery was unavailable in the isolated UI profile.

How to test

  1. In a desktop Agents window with chat.remoteAgentHostsEnabled enabled, select Remotes below the Sessions list.
  2. Confirm the dialog opens the Remotes tree, with WSL omitted on macOS/Linux, and that the page aligns with Plugins.
  3. Toggle a known remote. Confirm both navigation badges update together and the remote is added/removed in the New Session location picker. Set chat.remoteAgentHostsAutoConnect to false to test offline registration.
  4. Search, collapse/expand groups, and use Tab/Space on the switches. Check that search does not change the enabled-count badges.
  5. Reopen/reload and verify the registered locations and badges persist. Simulate a discovery failure and inspect the affected group's warning tooltip; retry with Refresh.
  6. Use accessibility help and the accessible view while focused on Remotes.

Validation

Rebased without conflicts onto origin/main at f82f4adff5e; git range-diff confirmed the feature commit was unchanged by the rebase.

  • npm run compile-client -- passed, including client type checking. The first attempt detected the upstream SDK version mismatch; npm run install-fast restored the declared dependencies, and the subsequent compile passed.
  • git diff --name-only --diff-filter=ACM -z origin/main...HEAD -- '*.ts' | xargs -0 npm run eslint -- -- passed, 32 changed TypeScript files.
  • npm run valid-layers-check -- passed.
  • npm run stylelint -- src/vs/sessions/contrib/providers/remoteAgentHost/browser/media/remotesWidget.css src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css -- passed, with 96 pre-existing design-token suggestions in the shared stylesheet.
  • git diff --check -- passed. Commit hygiene hooks also passed.
  • Focused regression selection below -- 232 passed after rebase.
Exact focused test command
./scripts/test.sh \
  --run src/vs/platform/agentHost/test/common/devContainerAgentHostIpc.test.ts \
  --run src/vs/platform/agentHost/test/electron-browser/wslRemoteAgentHostService.test.ts \
  --run src/vs/platform/agentHost/test/node/devContainerAgentHostService.test.ts \
  --run src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/devContainerAgentHostService.test.ts \
  --run src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/entryDrivenProviderContribution.test.ts \
  --run src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/sshAgentHost.contribution.test.ts \
  --run src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/wslAgentHost.contribution.test.ts \
  --run src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remotesModel.test.ts \
  --run src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remotesWidget.test.ts \
  --run src/vs/sessions/contrib/sessions/test/browser/customizationsToolbar.test.ts \
  --run src/vs/workbench/contrib/chat/test/browser/aiCustomization/aiCustomizationManagementEditor.test.ts \
  --reporter dot

Before rebase, live macOS Dev 1.144.0 scenarios passed for sidebar/dialog entry points, Plugins inset parity, warning tooltips, keyboard navigation, accessibility help/focus restoration, actual picker addition/removal, and synchronized badges across filtering and reload. Dark/light, narrow, empty, and Windows-grouping fixtures were inspected. These UI scenarios were not rerun after rebase. Full smoke/integration suites and Windows/Linux live validation were not run.

Add grouped remote discovery and show/hide switches using existing location registration, with shared enabled counts, refresh warnings, and accessibility support.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 21, 2026 08:20
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open issues
What changed in this PR

Adds a new Remotes management surface to Customizations in the desktop Agents window, letting users control which known remote locations appear in the New Session picker (with shared, live navigation badge counts).

Changes:

  • Introduces a Remotes contributed section (widget + model) with grouped inventory, enable/disable toggles, refresh warnings, keyboard/a11y support, and fixtures/tests.
  • Adds observable count support for contributed sections and wires it into navigation/sidebar badges without instantiating widgets.
  • Adds registration-only APIs for WSL and Dev Container workspaces plus Dev Container desktop IPC discovery plumbing and tests.
File Description
src/​vs/​workbench/​contrib/​chat/​test/​browser/​aiCustomization/​aiCustomizationManagementEditor.test.ts Updates editor tests to cover contributed navigation counts without widget creation.
src/​vs/​workbench/​contrib/​chat/​common/​aiCustomizationWorkspaceService.ts Adds Remotes to the management section enum.
src/​vs/​workbench/​contrib/​chat/​browser/​aiCustomization/​media/​aiCustomizationManagement.css Extends shared layout styles to the new customization list container.
src/​vs/​workbench/​contrib/​chat/​browser/​aiCustomization/​aiCustomizationManagementSectionRegistry.ts Adds optional observable count to contributed sections.
src/​vs/​workbench/​contrib/​chat/​browser/​aiCustomization/​aiCustomizationManagementEditor.ts Plumbs contributed counts into sections + registers count observers.
src/​vs/​workbench/​contrib/​accessibility/​browser/​accessibilityConfiguration.ts Adds verbosity setting for Remotes accessibility help.
src/​vs/​sessions/​sessions.desktop.main.ts Registers the desktop Remotes customization contribution.
src/​vs/​sessions/​contrib/​sessions/​test/​browser/​customizationsToolbar.test.ts Adds tests for Remotes badge behavior and menu contribution gating.
src/​vs/​sessions/​contrib/​sessions/​browser/​customizationsToolbar.contribution.ts Adds Remotes item + supports observable counts in toolbar totals/badges.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesWidget.test.ts New tests for RemotesWidget UI behavior, a11y, warnings, focus, search.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesWidget.fixture.ts New themed fixtures for Remotes widget snapshots.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesModel.test.ts New tests for RemotesModel discovery/merge/remove/count behavior.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​entryDrivenProviderContribution.test.ts Adds regression test for offline SSH/WSL reconciliation.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​devContainerAgentHostService.test.ts Adds test for offline Dev Container workspace registration/removal persistence.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​electron-browser/​remotesCustomization.contribution.ts New desktop contribution registering Remotes section + accessible view providers.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​wslAgentHost.contribution.ts Schedules WSL reconcile to avoid lazy-service construction reentrancy.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​sshAgentHost.contribution.ts Triggers reconcile on configured-entry changes (offline registration).
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesWidget.ts New RemotesWidget implementation (tree, toggles, refresh, a11y, warnings).
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesModel.ts New RemotesModel implementation (discovery, merge, enable/disable, counts).
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​media/​remotesWidget.css New styling for Remotes widget list rows and warning icon.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​devContainerAgentHostService.ts Adds workspace registration/removal/list APIs for offline locations.
src/​vs/​sessions/​contrib/​chat/​browser/​aiCustomizationWorkspaceService.ts Includes Remotes in Sessions management sections list.
src/​vs/​sessions/​common/​devContainerAgentHostService.ts Extends devcontainer agent host service interface with workspace APIs.
src/​vs/​sessions/​AI_CUSTOMIZATIONS.md Documents Remotes contributed section and count behavior.
src/​vs/​platform/​agentHost/​test/​node/​devContainerAgentHostService.test.ts Adds tests for docker discovery list behavior and error surfacing.
src/​vs/​platform/​agentHost/​test/​electron-browser/​wslRemoteAgentHostService.test.ts Adds test for persistent offline WSL distro registration.
src/​vs/​platform/​agentHost/​test/​common/​devContainerAgentHostIpc.test.ts New tests for discovery cancellation forwarding + unbuffered events.
src/​vs/​platform/​agentHost/​node/​devContainerAgentHostService.ts Adds listDevContainers docker enumeration for desktop/local discovery.
src/​vs/​platform/​agentHost/​electron-browser/​wslRemoteAgentHostServiceImpl.ts Adds cacheDistro API for offline WSL registration.
src/​vs/​platform/​agentHost/​common/​wslRemoteAgentHost.ts Extends WSL service interface with cacheDistro.
src/​vs/​platform/​agentHost/​common/​devContainerAgentHostIpc.ts Adds helper channel wrapper to route cancellation without serializing tokens.
src/​vs/​platform/​agentHost/​common/​devContainerAgentHost.ts Adds IDiscoveredDevContainer + optional listDevContainers API.
src/​vs/​platform/​agentHost/​browser/​nullWslRemoteAgentHostService.ts Implements cacheDistro for null service (throws on unsupported platform).
src/​vs/​platform/​accessibility/​browser/​accessibleView.ts Adds AccessibleViewProviderId.Remotes.
src/​vs/​code/​electron-utility/​sharedProcess/​sharedProcessMain.ts Switches Dev Container channel registration to the new IPC helper.

Review effort: Lite

Comment on lines +107 to +116
const discover = async (kind: RemoteKind, task: () => Promise<readonly RemoteTarget[]>): Promise<RemoteKind | undefined> => {
try {
const targets = await task();
if (!token.isCancellationRequested && !this._store.isDisposed && this.enabled) {
for (const target of targets) {
this.targets.set(this.getId(target), target);
}
this.update();
}
} catch (error) {
await this.disconnect(workspaceUri);
const key = getComparisonKey(workspaceUri);
this._removeStoredConnection(key);
this._removeProvider(key);
Comment on lines +98 to +104
Open Remotes from the picker without changing the selected environment, and document the action in accessibility help.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Open Remotes only from the Environment picker, remove its Customizations entries and badge plumbing, and preserve discovery lifetime and accessibility behavior.

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

This branch has not been deployed

No deployments
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.

2 participants