Skip to content

sessions: Surface remote connection errors and fix Remotes layout - #344135

Merged
Christof Marti (chrmarti) merged 5 commits into
mainfrom
chrmarti/remotes-status-layout
Oct 25, 2026
Merged

Christof Marti (chrmarti) merged 5 commits into
mainfrom
chrmarti/remotes-status-layout

Conversation

@chrmarti

Copy link
Copy Markdown
Collaborator

Stacked on #344083 (chrmarti/remotes-environment-delete).

Fixes #343964. Fixes #343981.

Changes

  • Show a warning icon beside Disconnected when a connection failed. The warning hover, status hover, row accessibility label, and Accessible View expose the connection error. Preserve the existing plain disconnected state for cancellations; reconnecting/connected rows do not retain a stale warning.
  • Retain the error at the connection-factory and handshake boundaries, and preserve it through the SSH/WSL managed-reconnect handler instead of replacing it with a plain disconnected status. Retry policies remain unchanged.
  • Fix empty-row scrolling: account for the header border in the virtualized viewport, reserve space for the horizontal scrollbar when needed, and use mouse-positioned row-text hovers that do not open under the pointer and intercept wheel input.
  • Match Language Models' gutter hierarchy: group chevrons are left-aligned and Show/Hide icons right-aligned within a wider gutter. Visibility actions remain visible at rest.
  • Add regression tests, short-window/error fixtures, and accessible help for connection failures.

Investigation

For #343964, factory/handshake failures discarded their display message, and the managed SSH reconnect handler reset the provider to plain Disconnected. Keeping the actual failure in the status lets Remotes show it without changing connection orchestration.

For #343981, the current layout could clip the final row by the header's unaccounted border, with further overlap from the horizontal scrollbar in narrow windows. A live narrow-window probe also stalled at scrollTop 100 with 6 pixels remaining: the empty-row text hover had opened directly under the stationary pointer and was consuming wheel events. Moving off the hover completed scrolling. With these changes the same stationary-pointer wheel sequence reaches the full final row, and Tab reaches Remote Tunnels Guide.

Validation

Passed:

npm run build-fast -- --client-only
npm run typecheck-client
.\scripts\test.bat --run src\vs\platform\agentHost\test\electron-browser\remoteAgentHostService.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\managedReconnectAgentHostContribution.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteHostOptions.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --reporter dot
npm run test-browser-no-install -- --browser webkit --browser chromium-msedge --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\managedReconnectAgentHostContribution.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remoteHostOptions.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesModel.test.ts --reporter dot

The combined runs passed 239 Electron tests and 291 browser tests. After the final row-hover regression was added, the affected suite was rerun successfully:

.\scripts\test.bat --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --reporter dot
npm run test-browser-no-install -- --browser webkit --browser chromium-msedge --run src\vs\sessions\contrib\providers\remoteAgentHost\test\browser\remotesWidget.test.ts --reporter dot

Final widget results: 58 Electron tests; 57 in each browser.

Changed-TypeScript ESLint passed (12 files), CSS stylelint passed, direct hygiene passed (13 files), and git diff --check passed.

Component Explorer rendered/disposed all 8 new themed fixtures without errors. Inspected the connection warning in dark, light, and both high-contrast themes. An isolated Edge interaction verified the exact error hover and stationary-pointer wheel scrolling plus keyboard access to the bottom setup link at both 700px and 360px widths. The final row ends at the list viewport bottom (204px wide, 194px narrow, with 10px reserved for the horizontal scrollbar).

Full workbench SSH authentication/connection flows, full smoke tests, and non-Windows native platforms were not exercised. Connection failure propagation is covered by service/retry tests; UI interactions use fixture data.

Manual test

  1. Follow Connecting to an unreachable SSH host silently returns to Disconnected #343964 using an unreachable SSH port and auto-connect disabled. Connect from Remote Environments and verify Disconnected has a warning whose hover shows the error.
  2. Retry with a reachable host; verify the warning clears. Ordinary disconnected rows should have no warning.
  3. With enough rows to scroll, put the window in a short/narrow layout and scroll over an empty Tunnels row. Its setup link should be fully reachable, including after text hovers appear.
  4. Verify group chevrons sit left of the persistent Show/Hide icons and all actions remain keyboard-operable.

Retain connection failure details for disconnected warning hovers and accessibility. Keep the final row scrollable, avoid row-text hovers intercepting wheel input, and separate group chevrons from visibility controls.

Fixes #343964. Fixes #343981.

Co-authored-by: Copilot <[email protected]>
Base automatically changed from chrmarti/remotes-environment-delete to main October 25, 2026 14:30
Populate empty aggregate error messages before IPC serialization so dual-stack SSH failures show their address and port instead of an unknown error. Cover IPC round trips and preserve existing messages and error codes.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 25, 2026 17:13
@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: 471b308a Current: c86eea09

Changed (19)

sessions/remotes/remotesWidget/Environments/Light
Before After
before after
sessions/remotes/remotesWidget/EnvironmentActions/Light
Before After
before after
sessions/remotes/remotesWidget/RefreshingTunnels/Light
Before After
before after
sessions/remotes/remotesWidget/TunnelDiscoveryFailure/Light
Before After
before after
sessions/remotes/remotesWidget/TunnelSignIn/Light
Before After
before after
sessions/remotes/remotesWidget/TunnelSigningIn/Light
Before After
before after
sessions/remotes/remotesWidget/TunnelSignInNarrow/Light
Before After
before after
sessions/remotes/remotesWidget/EnvironmentsNarrow/Light
Before After
before after
sessions/remotes/remotesWidget/EnvironmentsEmpty/Light
Before After
before after
sessions/remotes/remotesWidget/EnvironmentsWarning/Light
Before After
before after
sessions/remotes/remotesWidget/Table/Light
Before After
before after
sessions/remotes/remotesWidget/Wide/Light
Before After
before after
sessions/remotes/remotesWidget/Windows/Light
Before After
before after
sessions/remotes/remotesWidget/Narrow/Light
Before After
before after
sessions/remotes/remotesWidget/Empty/Light
Before After
before after
sessions/remotes/remotesWidget/EmptyWindows/Light
Before After
before after
sessions/remotes/remotesWidget/EmptyNarrow/Light
Before After
before after
sessions/remotes/remotesWidget/RefreshWarnings/Light
Before After
before after
sessions/remotes/remotesWidget/EmptyRefreshWarnings/Light
Before After
before after

Added (4)

sessions/remotes/remotesWidget/ConnectionError/Light

current

sessions/remotes/remotesWidget/ConnectionRetry/Light

current

sessions/remotes/remotesWidget/ShortEmpty/Light

current

sessions/remotes/remotesWidget/ShortEmptyNarrow/Light

current

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 scoped fixes preserve retry behavior, have focused regression coverage, and leave no unresolved blocking findings.

No open issues 🎉

What changed in this PR

This PR addresses silent remote connection failures and clipped Remotes rows in the Agents Window, building on the environment-management work in #344083.

Changes:

  • Preserve connection errors through SSH, connection-factory, handshake, and managed-reconnect paths, then expose them through warnings, hovers, and accessible content.
  • Correct viewport sizing, reserve horizontal scrollbar space, and adjust row hovers and gutter alignment.
  • Add regression tests and fixtures for connection failures and short or narrow layouts.

No blocking issues remain. Reported validation covers focused automated tests and fixture interactions; live SSH authentication flows and non-Windows native platforms were not exercised.

File Description
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesWidget.test.ts Tests warnings, accessibility, gutter alignment, scrolling, and hovers.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesWidget.fixture.ts Adds connection-error and short-window fixtures.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remoteHostOptions.test.ts Tests error details in disconnected-status hovers.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​managedReconnectAgentHostContribution.test.ts Tests reconnect error retention and cancellation behavior.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​electron-browser/​remotes.contribution.ts Documents connection warnings in accessibility help.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesWidget.ts Updates viewport sizing, column widths, and accessible error labels.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesTable.ts Renders connection warnings and mouse-positioned empty-row hovers.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remoteHostOptions.ts Includes connection errors in status hovers.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​media/​remotesWidget.css Styles warnings, header sizing, and gutter alignment.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​managedReconnectAgentHostContribution.ts Preserves failure details on managed-reconnect providers.
src/​vs/​platform/​agentHost/​test/​node/​sshRemoteAgentHostService.test.ts Tests SSH error details surviving serialization.
src/​vs/​platform/​agentHost/​test/​electron-browser/​remoteAgentHostService.test.ts Tests factory and handshake failures, cancellation, and recovery.
src/​vs/​platform/​agentHost/​node/​sshRemoteAgentHostService.ts Supplies messages for otherwise empty aggregate SSH errors.
src/​vs/​platform/​agentHost/​common/​remoteAgentHostService.ts Adds an optional display message to disconnected status.
src/​vs/​platform/​agentHost/​browser/​remoteAgentHostServiceImpl.ts Retains connection failure messages while omitting cancellation errors.

Review effort: Balanced

Show connection warnings only for user-requested attempts, including explicit joins of pending background connections. Keep automatic failures in diagnostics without changing retry behavior.

Co-authored-by: Copilot <[email protected]>
Preserve the last user-visible connection failure while automatic retries are pending, update it on failure, and clear it on success. Keep tunnel discovery from resetting the warning and anchor the icon to the Connection column's right edge.

Co-authored-by: Copilot <[email protected]>
Keep lastConnectionError on service-owned connection metadata and consume it independently in Remotes and picker hovers. Preserve warning retention through retries, cleanup, and right alignment while simplifying the status union.

Co-authored-by: Copilot <[email protected]>
@chrmarti
Christof Marti (chrmarti) merged commit 60f1335 into main Oct 25, 2026
44 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the chrmarti/remotes-status-layout branch October 25, 2026 20:41
@vs-code-engineering vs-code-engineering Bot added this to the 1.144.0 milestone Oct 25, 2026
Christof Marti (chrmarti) added a commit that referenced this pull request Oct 25, 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.
-->

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

Empty tunnels item goes off the bottom of the list Connecting to an unreachable SSH host silently returns to Disconnected

3 participants