Skip to content

sessions: Enable and gate Remote Environments management - #344158

Merged
Christof Marti (chrmarti) merged 3 commits into
mainfrom
chrmarti/remotes-environment-manage-menu
Oct 25, 2026
Merged

Christof Marti (chrmarti) merged 3 commits into
mainfrom
chrmarti/remotes-environment-manage-menu

Conversation

@chrmarti

@chrmarti Christof Marti (chrmarti) commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Built on #344135 (chrmarti/remotes-status-layout). That parent merged while this follow-up was being published, so this PR targets main.

Refs #343790. Follow-up test plan: #344161.

Changes

Enable sessions.chat.experimental.environmentPickerManageRemotes by default. Require that setting, the Environment picker, remote agent hosts, and AI features for the Command Palette and Sessions overflow entries. Apply the same checks when executing the command and disable an open editor if its prerequisites change.

Hide redundant per-environment Manage submenus only when both the Environment picker and central management are enabled and the user-local environment is managed by Remote Environments.

The picker previously recognized environments only through staged connection-factory entries. Mission Control publishes providers from its account inventory before any connection is staged, so a discovered environment could retain a Manage submenu despite already appearing in the central editor.

Use the enabled, account-scoped user-local inventory as the source of truth, matching Remotes. Preserve per-host management for WebSocket, unsupported/unknown kinds, and environments absent from the available inventory. Turning the management setting off restores per-entry Manage.

Fix screenshot CI by registering the inventory service in the New Session fixture harness; the new picker dependency previously caused its fixtures to fail during construction.

Validation

  • npm run gulp compile-client — passed for the initial submenu fix, zero compilation/type errors.
  • npm run build-fast -- --client-only — passed for the default/gating update.
  • npm run typecheck-client — passed, including the fixture dependency fix.
  • .\scripts\test.bat --run src\vs\sessions\contrib\providers\remoteAgentHost\test\electron-browser\remotesEditor.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts --run src\vs\sessions\contrib\chat\test\browser\newSessionComposerLayout.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionsChatAccessibilityHelp.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteAgentHostSessionsProvider.test.ts --reporter dot — 433 passed.
  • npm run test-browser-no-install -- --browser webkit --browser chromium-msedge --run src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts --reporter dot — 22 passed in each browser.
  • .\scripts\test.bat --run src\vs\sessions\contrib\chat\test\browser\newChatWidget.test.ts --run src\vs\sessions\contrib\chat\test\browser\sessionWorkspacePicker.test.ts --reporter dot — 372 passed, 1 pending.
  • npm run eslint -- src\vs\sessions\contrib\chat\browser\sessionEnvironmentPicker.ts src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts — passed.
  • node build\hygiene.ts src\vs\sessions\contrib\chat\browser\sessionEnvironmentPicker.ts src\vs\sessions\contrib\chat\test\browser\sessionEnvironmentPicker.test.ts — passed.
  • git diff --check — passed.
  • Changed-TypeScript ESLint and hygiene — passed.
  • Component Explorer render/dispose error check for sessions/chat/newWidget/newChatWidget/ — 122 fixtures passed, zero errors. Inspected the previously failing NewSessionDefault/Light screenshot.

Tests cover the default-on schema and visibility preferences, inventory-only and staged environments, online/offline records, ordinary row selection, management/Environment picker/remote-host gates, open-editor disposal, command rejection, inventory availability, sign-out/account withdrawal, and retained management for unsupported kinds.

Manual test

  1. Enable the Environment picker, remote agent hosts, and GitHub Environments for an eligible account. Leave Remotes management unset to exercise its new default. Discover a shared user-local machine without connecting to it from this window.
  2. Open the Environment picker. Its environment row should have no per-entry Manage submenu, and selecting it should still work. Use the bottom Manage action for the central editor.
  3. Connect and disconnect the environment; reopen the picker and verify the submenu stays absent while the inventory includes it.
  4. Disable the Remotes management setting and reopen the picker: the per-entry Manage action should return. Configured WebSocket hosts should retain their management route in either mode.
  5. Disable the Environment picker or remote agent hosts: the Command Palette and Sessions overflow entries should disappear. Turning the Environment picker back on should restore management. With the Environment picker off, do not suppress per-entry Manage submenus.

Live provider/account flows were not exercised for this fix; picker interaction is covered using the production picker with test services.

Recognize user-local environments from their enabled account inventory instead of requiring a staged connection. Preserve fallback management for unsupported hosts and cover setting and inventory changes.

Co-authored-by: Copilot <[email protected]>

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.

🟢 Approval recommended

The focused fix preserves fallback management and has targeted regression coverage, with no unresolved findings; live provider/account flows remain untested.

No open issues 🎉

What changed in this PR

Fixes redundant per-environment Manage submenus in the Sessions Environment picker by recognizing shared environments before a connection is staged.

Changes:

  • Uses enabled, account-scoped user-local inventory to determine central management coverage.
  • Preserves per-entry management for unsupported hosts and unavailable inventory.
  • Adds regression coverage for setting changes, inventory availability, account withdrawal, and row selection.
File Description
src/​vs/​sessions/​contrib/​chat/​test/​browser/​sessionEnvironmentPicker.test.ts Covers inventory-based menu visibility and fallback behavior.
src/​vs/​sessions/​contrib/​chat/​browser/​sessionEnvironmentPicker.ts Checks account inventory instead of staged environment connections.

Review effort: Balanced

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Base: 60f13350 Current: db1d0809

No screenshot changes.

Default Remote Environments management on while requiring the Environment picker and remote agent hosts for its command, menu entry and redundant submenu suppression. Apply gate changes to open editors and preserve explicit visibility preferences.

Co-authored-by: Copilot <[email protected]>
Provide the picker inventory dependency in the fixture harness so screenshot and Playwright fixtures render after the environment Manage submenu fix.

Co-authored-by: Copilot <[email protected]>
@chrmarti Christof Marti (chrmarti) changed the title sessions: Hide redundant Manage menus for shared environments sessions: Enable and gate Remote Environments management Oct 25, 2026
@chrmarti
Christof Marti (chrmarti) marked this pull request as ready for review October 25, 2026 21:26
@chrmarti
Christof Marti (chrmarti) merged commit 998035b into main Oct 25, 2026
44 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the chrmarti/remotes-environment-manage-menu branch October 25, 2026 21:31
@vs-code-engineering vs-code-engineering Bot added this to the 1.144.0 milestone Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants