Skip to content

remote: configurable 'reconnection grace time'#274910

Merged
joshspicer merged 4 commits into
mainfrom
joshspicer/reconnection-grace
Nov 13, 2025
Merged

remote: configurable 'reconnection grace time'#274910
joshspicer merged 4 commits into
mainfrom
joshspicer/reconnection-grace

Conversation

@joshspicer
Copy link
Copy Markdown
Member

@joshspicer joshspicer commented Nov 3, 2025

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

Copilot AI review requested due to automatic review settings November 3, 2025 23:01
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 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-time CLI 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

Comment thread src/vs/workbench/api/node/extensionHostProcess.ts Outdated
Comment thread src/vs/server/node/serverEnvironmentService.ts
@joshspicer joshspicer force-pushed the joshspicer/reconnection-grace branch from a9e86c2 to 1127d2a Compare November 10, 2025 19:11
@joshspicer joshspicer force-pushed the joshspicer/reconnection-grace branch from 780bc9a to 26fc187 Compare November 11, 2025 18:24
@joshspicer joshspicer changed the title reconnection grace period prototype remote: configurable 'reconnection grace time' Nov 12, 2025
@joshspicer joshspicer requested a review from Copilot November 12, 2025 22:27
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

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Comment thread src/vs/platform/remote/common/remoteAgentConnection.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@joshspicer joshspicer marked this pull request as ready for review November 13, 2025 01:20
@vs-code-engineering vs-code-engineering Bot added this to the November 2025 milestone Nov 13, 2025
@joshspicer joshspicer enabled auto-merge (squash) November 13, 2025 01:35
@joshspicer joshspicer merged commit 6cc2564 into main Nov 13, 2025
55 checks passed
@joshspicer joshspicer deleted the joshspicer/reconnection-grace branch November 13, 2025 02:51
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Dec 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants