feat: expose --reconnection-grace-time CLI flag#7678
Open
tianyicui wants to merge 1 commit intocoder:mainfrom
Open
feat: expose --reconnection-grace-time CLI flag#7678tianyicui wants to merge 1 commit intocoder:mainfrom
tianyicui wants to merge 1 commit intocoder:mainfrom
Conversation
Pass through VS Code Server's --reconnection-grace-time argument, allowing users to configure how long the server waits for a disconnected client to reconnect before cleaning up the session. This is useful for users whose client machines sleep overnight, causing the default 3-hour grace period to expire and forcing a "Reload Window" on wake. The flag can also be set via $CS_RECONNECTION_GRACE_TIME env var or in config.yaml. Fixes coder#7665 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
--reconnection-grace-timeCLI argument through code-server, allowing users to configure how long the server waits for a disconnected client to reconnect before cleaning up the session$CS_RECONNECTION_GRACE_TIMEenvironment variable andconfig.yamlsettingserverEnvironmentService.ts; code-server just wasn't passing it throughMotivation
When a client machine sleeps (e.g., overnight), the WebSocket connection drops. VS Code Server's default 3-hour reconnection grace time expires, the server discards the reconnection token, and the user is forced to "Reload Window" on wake. Users who want longer grace periods currently have no way to configure this.
Fixes #7665
Changes
src/node/cli.ts: Addedreconnection-grace-timetoUserProvidedCodeArgsinterface,optionsobject, andsetDefaults()(env var support via$CS_RECONNECTION_GRACE_TIME)test/unit/node/cli.test.ts: Added test for the new flag in the "parse all options" test and a dedicated env var testUsage
Test plan
--reconnection-grace-timeis parsed correctly from CLI$CS_RECONNECTION_GRACE_TIMEenv var is picked up insetDefaults()🤖 Generated with Claude Code