Skip to content

sessions: Improve Remotes search and tunnel sign-in - #344078

Merged
Christof Marti (chrmarti) merged 4 commits into
mainfrom
chrmarti/remotes-search-signin
Oct 24, 2026
Merged

Christof Marti (chrmarti) merged 4 commits into
mainfrom
chrmarti/remotes-search-signin

Conversation

@chrmarti

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

Copy link
Copy Markdown
Collaborator

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):

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.
Commands and results

All passed:

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:

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

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

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.

Add inline clear and collapse actions, and offer explicit tunnel permission sign-in instead of a generic discovery error when no usable token exists.

Co-authored-by: Copilot <[email protected]>
Base automatically changed from chrmarti/remote-environments-visibility to main October 24, 2026 20:45
Copilot AI balanced review requested due to automatic review settings October 24, 2026 20:59
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot Changes

Base: f3640a90 Current: 8b7b9c88

Changed (15)

sessions/remotes/remotesWidget/Environments/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/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 (3)

sessions/remotes/remotesWidget/TunnelSignIn/Light

current

sessions/remotes/remotesWidget/TunnelSigningIn/Light

current

sessions/remotes/remotesWidget/TunnelSignInNarrow/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.

🟡 Changes recommended

Sign-in can indirectly register and connect hosts, and GitHub OAuth cancellation is incorrectly reported as an error.

2 open issues
What changed in this PR

This PR extends Remote Environments management in the Agents Window with search controls and explicit tunnel sign-in recovery, building on the remote visibility controls.

Changes:

  • Adds Clear Search and Collapse All actions inside the search field.
  • Distinguishes missing tunnel credentials from discovery failures and provides a Sign In action.
  • Updates accessibility help, themed fixtures, and regression tests.
File Description
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​electron-browser/​tunnelAgentHostServiceImpl.test.ts Tests configured scopes, authentication errors, cancellation, and gating.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​electron-browser/​remotesEditor.test.ts Updates the model stub for sign-in recovery.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesWidget.test.ts Tests search actions and sign-in interaction states.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesWidget.fixture.ts Adds wide and narrow sign-in fixtures.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​test/​browser/​remotesModel.test.ts Tests authentication state and cached-host preservation.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md Documents discovery-only sign-in recovery.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​electron-browser/​tunnelAgentHostServiceImpl.ts Adds explicit sign-in and typed authentication failures.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​electron-browser/​remotes.contribution.ts Updates accessibility help for the new actions.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesWidget.ts Implements search controls and sign-in recovery flow.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesTable.ts Renders the sign-in link and manages keyboard focus.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​remotesModel.ts Exposes authentication state and delegates sign-in.
src/​vs/​sessions/​contrib/​providers/​remoteAgentHost/​browser/​media/​remotesWidget.css Aligns actions inside the search field.
src/​vs/​platform/​agentHost/​common/​tunnelAgentHost.ts Defines the authentication error and optional sign-in API.

Review effort: Balanced

Normalize GitHub Authentication's documented cancellation results while preserving ordinary authentication listeners and auto-connect behavior.

Co-authored-by: Copilot <[email protected]>
@chrmarti
Christof Marti (chrmarti) force-pushed the chrmarti/remotes-search-signin branch from dcb501f to 5d70cf5 Compare October 24, 2026 21:44
@chrmarti
Christof Marti (chrmarti) marked this pull request as ready for review October 24, 2026 21:50
@chrmarti
Christof Marti (chrmarti) merged commit 86db3b6 into main Oct 24, 2026
105 of 107 checks passed
@chrmarti
Christof Marti (chrmarti) deleted the chrmarti/remotes-search-signin branch October 24, 2026 22:18
@vs-code-engineering vs-code-engineering Bot added this to the 1.144.0 milestone Oct 24, 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