agent-host: Pause SSH reconnect after auth cancellation#316810
Merged
Conversation
…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>
Contributor
There was a problem hiding this comment.
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>
dmitrivMS
approved these changes
May 17, 2026
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.
Summary
Validation
(Written by Copilot)