Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 11, 2025

Setting --reconnection-grace-time to a negative value (e.g., -1000) causes the CLI parser to fail with "unexpected argument '-1' found".

Changes

CLI argument parsing

  • Changed reconnection_grace_time type from Option<u32> to Option<i32> in cli/src/commands/args.rs and cli/src/tunnels/code_server.rs
  • Allows the CLI to parse negative values without error
  • Existing TypeScript validation in parseGraceTime() already handles negative values by falling back to defaults

Tests

  • Added unit tests in src/vs/server/test/node/serverEnvironmentService.test.ts covering negative, zero, empty, and invalid value handling

The unsigned integer constraint at the CLI layer was premature - validation properly occurs in TypeScript where negative values are rejected with logging.

Original prompt

This section details on the original issue you should resolve

<issue_title>Negative values break server launch</issue_title>
<issue_description>Testing #280450

  • Set reconnectionGraceTime to -1000
  • Restart the server

[20:05:54.210] > error: unexpected argument '-1' found

</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 11, 2025 23:39
Changed reconnection_grace_time type from u32 to i32 to allow negative values to be parsed by the CLI. The TypeScript validation logic already handles negative values by falling back to the default value.

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Added comprehensive unit tests for the reconnectionGraceTime parsing logic, including tests for negative values, positive values, zero, empty strings, and invalid values.

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Fixed test to use actual product service and ProtocolConstants for more accurate and maintainable assertions.

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix negative values breaking server launch Fix negative values breaking server launch in --reconnection-grace-time Dec 11, 2025
Copilot AI requested a review from joshspicer December 11, 2025 23:54
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.

Negative values break server launch

2 participants