Repository navigation
sessions: Add Remote Environments picker visibility controls - #344034
Merged
Christof Marti (chrmarti) merged 9 commits intoOct 24, 2026
Merged
Conversation
Base automatically changed from
chrmarti/remote-environments-entrypoints
to
main
October 24, 2026 09:43
Layer a profile-local hidden preference over existing provider availability and expose Show/Hide actions without affecting connections or sessions. Co-authored-by: Copilot <[email protected]>
Distinguish unavailable hosts from hidden preferences, share picker eligibility checks, and preserve visibility preferences across registration and availability changes. Co-authored-by: Copilot <[email protected]>
Christof Marti (chrmarti)
force-pushed
the
chrmarti/remote-environments-visibility
branch
from
October 24, 2026 12:26
039e5b3 to
50ab958
Compare
Contributor
Screenshot ChangesBase: Changed (9)Added (2) |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Hiding an otherwise available remote blocks submission of an existing draft because draft validation also checks picker visibility.
1 open issue
What changed in this PR
Adds per-remote picker visibility controls to the Agents Window’s Remote Environments editor, distinguishing user-hidden hosts from hosts that are currently unavailable.
Changes:
- Adds Show/Hide actions, unavailable indicators, accessible explanations, and high-contrast styling.
- Persists machine/profile-local preferences using stable host identities and account-scoped environment keys.
- Shares picker eligibility logic and adds storage, provider, model, and UI coverage.
| File | Description |
|---|---|
src/vs/sessions/contrib/providers/remoteAgentHost/test/electron-browser/remotesEditor.test.ts |
Updates the model stub for visibility controls. |
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remotesWidget.test.ts |
Tests toggling, focus retention, and unavailable indicators. |
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remotesWidget.fixture.ts |
Adds hidden/unavailable examples and high-contrast fixtures. |
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remotesModel.test.ts |
Tests eligibility, persistence, stable identities, and availability changes. |
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHostSessionsProvider.test.ts |
Tests combined visibility and availability without losing sessions. |
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHostPickerVisibility.test.ts |
Tests preference storage, propagation, and isolation. |
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/missionControlAgentHostContribution.test.ts |
Verifies account-scoped preference keys. |
src/vs/sessions/contrib/providers/remoteAgentHost/REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md |
Documents visibility ownership and behavior. |
src/vs/sessions/contrib/providers/remoteAgentHost/electron-browser/remotes.contribution.ts |
Adds visibility controls to accessibility help. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/remotesWidget.ts |
Handles visibility actions and accessible row descriptions. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/remotesTable.ts |
Renders eye actions and disabled unavailable indicators. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/remotesModel.ts |
Derives picker state and rejects ineligible visibility changes. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostSessionsProvider.ts |
Combines saved preferences with provider availability. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostPickerVisibility.ts |
Implements normalized keys and local preference storage. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/missionControlAgentHostContribution.ts |
Supplies account-qualified environment keys. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/media/remotesWidget.css |
Styles persistent indicators and dimmed names. |
src/vs/sessions/contrib/providers/remoteAgentHost/browser/entryDrivenProviderContribution.ts |
Forwards visibility preference keys to providers. |
src/vs/sessions/contrib/chat/browser/sessionEnvironmentPicker.ts |
Reuses the shared remote eligibility predicate. |
src/vs/sessions/common/agentHostSessionsProvider.ts |
Exposes availability separately and defines shared eligibility. |
Review effort: Balanced
Unhide explicit remote folder selections without overriding availability, keep existing drafts sendable on hidden connected hosts, and fix CI formatting. Co-authored-by: Copilot <[email protected]>
Show per-section spinners beside counts until each discovery completes, with cancellation-safe progress and accessible busy state. Co-authored-by: Copilot <[email protected]>
Restore original picker availability when remote management is off, retain saved hidden preferences, and gate the command, overflow entry and open editor. Co-authored-by: Copilot <[email protected]>
Link the section info action and empty-state guide to the planned vscode-agent-environments redirect. Co-authored-by: Copilot <[email protected]>
Keep automation history and restored remote container destinations independent of picker visibility. Surface per-section discovery failures immediately, including missing tunnel authentication. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…onments-visibility Co-authored-by: Copilot <[email protected]>
Christof Marti (chrmarti)
marked this pull request as ready for review
October 24, 2026 20:17
Christof Marti (chrmarti)
enabled auto-merge
October 24, 2026 20:19
Ben Villalobos (benvillalobos)
approved these changes
Oct 24, 2026
Christof Marti (chrmarti)
deleted the
chrmarti/remote-environments-visibility
branch
October 24, 2026 20:45
Christof Marti (chrmarti)
added a commit
that referenced
this pull request
Oct 24, 2026
<!-- Thank you for submitting a Pull Request. Please: * Read our Pull Request guidelines: https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests * Associate an issue with the Pull Request. * Ensure that the code is up-to-date with the `main` branch. * Include a description of the proposed changes and how to test them. --> Follow-up to #344034 (merged). This PR now targets `main`. ### Changes - Add right-aligned **Clear Search** and **Collapse All** actions inside the search field, following Language Models management. Clear Search restores input focus; Collapse All keeps the query and collapses the sections. - Replace the generic tunnel failure state for missing usable credentials (including a token without tunnel scopes) with **Sign in to allow access to your tunnels.** and a **Sign In** action. - Request the configured tunnel permissions only after explicit sign-in, then refresh discovery. The action does not directly connect or register a remote; normal authentication listeners, discovery, and configured auto-connect behavior remain unchanged. Show ordinary network failures as errors, prevent duplicate sign-in, and retain the recovery prompt on cancellation. - Normalize GitHub Authentication's documented `Cancelled` result into the standard cancellation error, so cancellation does not produce an error notification. Other provider errors still surface. - Update accessibility help and themed fixtures; preserve table keyboard navigation and unrelated connection actions. ### Validation Amended review follow-up: **100 Electron tests passed**, plus client type-check and targeted hygiene. The listener suppression and discovery-generation fencing were removed; the contribution and its tests are identical to the pre-review version. Coverage retains GitHub `Error('Cancelled')`/string cancellation normalization and checks that another provider's errors are not treated as GitHub cancellation. Follow-up commands (all passed): ```powershell npm run build-fast -- --client-only .\scripts\test.bat --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\tunnelAgentHost.contribution.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\tunnelAgentHostServiceImpl.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --reporter dot npm run typecheck-client node build\hygiene.ts src\vs\sessions\contrib\providers\remoteAgentHost\electron-browser\tunnelAgentHostServiceImpl.ts src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\tunnelAgentHostServiceImpl.test.ts ``` Earlier feature validation: - **131 Electron tests passed**. - **171 browser tests passed** across Chromium and WebKit (86/85; one WSL case is platform-gated). - Client type-check, changed-source hygiene (including formatting and ESLint), layer checks, and whitespace checks passed. - Inspected dark, narrow light, and light high-contrast fixtures; dark sign-in fixture stability passed. - An isolated Edge page verified actual Tab/arrow/Enter/Space navigation for Clear Search, Collapse All, and Sign In, including clear-input focus restoration. <details> <summary>Commands and results</summary> All passed: ```powershell npm run build-fast -- --client-only npm run typecheck-client npm run valid-layers-check $files = @(git diff --name-only -- '*.ts' '*.css') node build\hygiene.ts $files git diff --check ``` 131 passing: ```powershell .\scripts\test.bat --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\providers\remoteAgentHost\test\electron-browser\remotesEditor.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\tunnelAgentHostServiceImpl.test.ts --reporter dot ``` 171 passing: ```powershell npm run test-browser-no-install -- --browser webkit --browser chromium-msedge --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --reporter dot ``` </details> Manual follow-up: open Remote Environments with no tunnel-scoped session, confirm the plain-language prompt replaces the error, sign in, and confirm the tunnel list refreshes while normal authentication listeners and configured auto-connect behavior still apply. Verify cancellation and ordinary network failures remain distinguishable. Live OAuth consent, external tunnel discovery, and screen-reader output were not exercised; authentication tests use fake sessions and configured scope lists. No user credentials or scopes were modified during validation.
2 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Follow-up to #344031 (merged); rebased onto
origin/mainat4ff5ad971b5. Related test plan: #343790.Changes
sessions.chat.experimental.environmentPickerManageRemotes. With it off, pickers follow original availability rules, stored preferences remain intact, and the Command Palette/Sessions overflow entry points are hidden. An open management editor becomes disabled; setting changes apply live.remotesTable.ts. The new WSL action regression test also exposed an unused disposable setup action; use the existing non-disposable action helper instead.Previously, the New Session picker considered only registered providers with workspace-selection support, then applied visibility and grouping rules. Management also lists discovery-only entries. The initial version of this PR displayed the saved preference as if it meant actual visibility; this revision explicitly distinguishes those states.
How to test
sessions.chat.experimental.environmentPickerManageRemotes: previously hidden eligible remotes return to the pickers, offline environments remain excluded, and management commands disappear. Re-enable it and verify saved hidden preferences return. Selecting a remote while the feature is off must not erase those preferences.Validation
Latest regression follow-up: 305 Electron tests passed, 539 browser tests passed across Chromium and WebKit (270/269, with the WSL case platform-gated). Final client type-check, changed-source hygiene, layer checks, and whitespace checks passed. Inspected a stable dark fixture showing a tunnel failure while SSH is still spinning. Authentication tests use fake sessions; live tokens or permissions were not changed.
Commands (all passed):
Latest setting-gate follow-up: 376 Electron tests passed, client type-check and changed-source hygiene passed. Coverage includes default-off/live off/on transitions for SSH, tunnels, WSL, WebSocket and shared environments, independent availability, retained preferences, command/menu gates, direct invocation guards, and disabling an already-open editor.
Commands (all passed):
Latest icon/section-progress follow-up: 83 Electron tests passed, 151 browser tests passed across Chromium and WebKit, client type-check and changed-source hygiene passed. Dark and light high-contrast refreshing fixtures were inspected; the dark fixture passed screenshot stability and teardown checks.
Commands and results (all passed):
Latest selection/review follow-up:
npm run hygiene -- --changed-since ...gulp wrapper fails locally on Windows before source checks because its package validation resolvesC:\C:\.... No build-tool workaround was committed; the existing direct hygiene entry point below successfully checks the PR sources. Hosted CI's actual failure was the now-fixed formatting indentation.Commands and results (all passed):
Earlier eligibility revision on the rebased branch:
Exact commands and results
All passed:
478 passing:
171 passing (86 and 85; one WSL case is platform-gated):
Limitations: live backend connections, full-workbench end-to-end flows, and manual screen-reader output were not exercised. The isolated fixture did not render toolbar hovers; tooltip text was checked through the shared action tooltip/accessible-name path, while the unavailable explanation is also included in row and Accessible View text.