Skip to content

agent-host: Pause SSH reconnect after auth cancellation#316810

Merged
roblourens merged 3 commits into
mainfrom
roblou/pause-ssh-reconnect-auth-cancel
May 17, 2026
Merged

agent-host: Pause SSH reconnect after auth cancellation#316810
roblourens merged 3 commits into
mainfrom
roblou/pause-ssh-reconnect-auth-cancel

Conversation

@roblourens
Copy link
Copy Markdown
Member

Summary

  • pause startup SSH auto-reconnect when keyboard-interactive auth is canceled
  • keep cached sessions unpublished after cancellation instead of scheduling another retry
  • document the reconnect cancellation behavior and cover the classifier with a browser unit test

Validation

  • npm run compile-check-ts-native
  • npm run valid-layers-check
  • node --experimental-strip-types build/hygiene.ts src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.ts src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHost.contribution.test.ts src/vs/sessions/contrib/providers/remoteAgentHost/REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md
  • npm run transpile-client
  • ./scripts/test.sh --run src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHost.contribution.test.ts

(Written by Copilot)

…opilot)

When startup restore hits a keyboard-interactive prompt and the user cancels it, treat the cancellation as an intentional pause instead of a retryable reconnect failure. This avoids repeatedly reopening the password prompt during auto-reconnect. (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 16, 2026 22:54
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines the Agents window remote agent host startup SSH auto-reconnect behavior by treating keyboard-interactive authentication cancellation as an intentional “pause” rather than a failure that should trigger exponential backoff retries. It also documents that behavior and adds unit coverage for the cancellation classifier.

Changes:

  • Add a cancellation classifier (shouldPauseSSHReconnectAfterFailure) and use it to pause SSH auto-reconnect after keyboard-interactive auth cancellation, avoiding further retry scheduling.
  • Keep cached sessions unpublished when the reconnect is paused due to cancellation.
  • Document the reconnect-cancellation behavior and add a browser unit test for the classifier.
Show a summary per file
File Description
src/vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution.ts Adds cancellation classification and pauses SSH auto-reconnect (with cached-session unpublish) when cancellation is detected.
src/vs/sessions/contrib/providers/remoteAgentHost/test/browser/remoteAgentHost.contribution.test.ts Adds a unit test verifying cancellation pauses reconnect while normal errors do not.
src/vs/sessions/contrib/providers/remoteAgentHost/REMOTE_AGENT_HOST_SESSIONS_PROVIDER.md Documents that startup SSH auto-reconnect treats keyboard-interactive cancellation as a pause.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 0

Route host-picker reconnect and disconnect actions for stored SSH hosts through the SSH service. This lets a user manually reconnect after canceling startup auto-reconnect without deleting the stored host or hitting the generic WebSocket reconnect no-op. (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Route manual reconnects for stored SSH hosts through the SSH service even when the entry does not have an SSH config alias, and disconnect using the SSH connection key so the host picker can cancel or reconnect the right connection. (Written by Copilot)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@roblourens roblourens marked this pull request as ready for review May 17, 2026 00:54
@roblourens roblourens enabled auto-merge (squash) May 17, 2026 00:54
@roblourens roblourens merged commit 72b2cd0 into main May 17, 2026
25 checks passed
@roblourens roblourens deleted the roblou/pause-ssh-reconnect-auth-cancel branch May 17, 2026 01:07
@vs-code-engineering vs-code-engineering Bot added this to the 1.121.0 milestone May 17, 2026
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.

3 participants