remote: configurable 'reconnection grace time'#274910
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for configurable reconnection grace time in VS Code's remote connection system. The grace time controls how long the system waits for a disconnected client to reconnect before terminating the connection.
Key Changes:
- Added a
--reconnection-grace-timeCLI argument (in seconds) to override the default 3-hour reconnection window - Propagated the grace time from server environment through the remote agent environment to client connections
- Updated all reconnection logic to use the configurable grace time instead of hardcoded constants
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/vs/server/node/serverEnvironmentService.ts | Added CLI argument definition and parsing logic to convert seconds to milliseconds |
| src/vs/server/node/remoteAgentEnvironmentImpl.ts | Included reconnectionGraceTime in the environment data sent to clients |
| src/vs/platform/remote/common/remoteAgentEnvironment.ts | Added reconnectionGraceTime field to the IRemoteAgentEnvironment interface |
| src/vs/workbench/services/remote/common/remoteAgentEnvironmentChannel.ts | Added deserialization and defaulting logic for reconnectionGraceTime from server response |
| src/vs/workbench/services/remote/common/abstractRemoteAgentService.ts | Applied grace time to PersistentConnection when environment data is received |
| src/vs/platform/remote/common/remoteAgentConnection.ts | Added static method to update grace time and modified reconnection loop to use configurable grace time |
| src/vs/server/node/extensionHostConnection.ts | Set VSCODE_RECONNECTION_GRACE_TIME environment variable for extension host processes |
| src/vs/workbench/api/node/extensionHostProcess.ts | Read grace time from environment variable and applied to disconnection timers |
| src/vs/server/node/remoteExtensionManagement.ts | Updated ManagementConnection to accept and use configurable grace time |
| src/vs/server/node/remoteExtensionHostAgentServer.ts | Pass reconnectionGraceTime to ManagementConnection constructor |
| src/vs/server/node/serverServices.ts | Use configurable grace time for pty host connection timeouts |
a9e86c2 to
1127d2a
Compare
780bc9a to
26fc187
Compare
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
justschen
approved these changes
Nov 13, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Allow the reconnection grace time to be configured in the VS Code server process from its hardcoded value of 3 hours. CLI and server support a flag that is optionally passed from a remote extension (eg: SSH).