You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(shared): accept whitespace after engine range operators - #29730
The shared engine-range checker rejects valid requirements such as >= 24.0 < 24.10. It splits on whitespace before parsing comparators, separating each operator from its version. A compatible runtime is therefore reported as incompatible. The same checker is used for SSH startup, WSL runtime validation and provider compatibility.
Change
Join supported operators to their version before splitting the comparator group. Spaces, tabs and newlines after an operator now work while range bounds and OR groups keep their existing meaning. The function remains self-contained JavaScript for SSH startup's serialized copy.
Scope and approval
This is a small, focused correction to existing range parsing under CONTRIBUTING.md's obvious-bug exception. The comparator parser already accepts whitespace after an operator; the earlier tokenization prevented it from receiving those inputs. Searches for the helper, engine-range whitespace and related compatibility fixes found no open PR covering this defect. #29335 changes omitted zero-major caret bounds, a separate issue.
Verification
macOS, Node 26.12.1, base 71646e031a6d.
With main's implementation, the extended existing comparator test fails on 24.9.0 against >= 24.0 < 24.10; the other eight tests pass.
The regression covers spaces, tabs and newlines, the exclusive upper bound, and a caret range in an OR group.
vp run check:changed origin/main --concurrency 2 passed formatting, lint, both Knip checks, typechecks for 34 affected packages, and 10 tests in two selected files.
Direct runtime checks of the exported function and a copy reconstructed from its toString() both accept 24.9.0 / >= 24.0 < 24.10 and 22.16.0 / ^ 22.16 || >= 24.10, and both reject 24.10.0 / >= 24.0 < 24.10. Main incorrectly rejects both valid examples.
No live SSH host, WSL machine or provider installation was changed.
Reviewing files that changed from the base of the PR and between 6f535af and 33042a4.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
satisfiesSemverRange now parses recognized operators and following versions together when whitespace separates them. Tests cover spaces, tabs, and newlines in comparator ranges.
Changes: Semver range parsing
Layer / File(s)
Summary
Join operators and versions packages/shared/src/semver.ts, packages/shared/src/semver.test.ts
The parser removes whitespace between recognized range operators and following versions before splitting comparator groups. Tests cover spaces, tabs, newlines, and a caret alternative combined with `
The parser change is limited to the intended whitespace handling, with no actionable merge-blocking risk identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: accepting whitespace after engine range operators.
Description check
The description includes all required sections. It explains the problem, change, scope exception, approval rationale, focused verification, test results, and limitations.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
CodeRabbit Verify
Run CodeRabbit Verify to test the changes in this pull request.
Reviewing files that changed from the base of the PR and between 71646e0 and cd4e091.
Files selected for processing: 2
packages/shared/src/semver.test.ts
packages/shared/src/semver.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
verified the range parser and its serialized ssh node checker at 33042a41af594fc735a2b45ae5879ec51d455ee8 on linux with real node 24.22.1.
started github/main (61c3794c32) in a separate worktree, then stopped it before starting the exact pr head. used repository playwright with /usr/bin/google-chrome, isolated app state, projects added through the app, and browser-submitted codex gpt-6.1-sol turns. those turns invoked the production buildRemoteNodeEnvScript output in a real shell and returned its actual exit codes. no mocked runtime versions or provider responses.
main rejected >= 24.0 < 25, including tab/newline variants, despite the compatible runtime. the pr accepts all three.
the unspaced range still passes; >= 25.0 < 26 still rejects the installed runtime.
a follow-up turn verified exclusive < 24.22.1 rejects, inclusive <= 24.22.1 and = v24.22.1 accept, and the spaced OR fallback accepts.
reloading the app preserved the conversation, and the follow-up provider turn completed.
blacksmith ran vp i && vp test run packages/shared/src/semver.test.ts: all 9 tests passed. head CI also reports no failed or pending checks. no source changes or pushes were needed.
full desktop ssh connection setup, WSL, native mobile clients, and remote/relay/tunnel connection modes. this verifies the actual serialized checker through a browser-to-codex terminal turn, not desktop connection initiation. the web client has no engine-range control, and WSL requires Windows.
provider compatibility manifest ingestion was not exercised. its schema separately tokenizes ranges before calling this helper, so these results do not establish whitespace acceptance at that ingress.
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
size:XS0-9 changed lines (additions + deletions).vouch:unvouchedPR author is not yet trusted in the VOUCHED list.
2 participants
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.
Problem
The shared engine-range checker rejects valid requirements such as
>= 24.0 < 24.10. It splits on whitespace before parsing comparators, separating each operator from its version. A compatible runtime is therefore reported as incompatible. The same checker is used for SSH startup, WSL runtime validation and provider compatibility.Change
Join supported operators to their version before splitting the comparator group. Spaces, tabs and newlines after an operator now work while range bounds and OR groups keep their existing meaning. The function remains self-contained JavaScript for SSH startup's serialized copy.
Scope and approval
This is a small, focused correction to existing range parsing under CONTRIBUTING.md's obvious-bug exception. The comparator parser already accepts whitespace after an operator; the earlier tokenization prevented it from receiving those inputs. Searches for the helper, engine-range whitespace and related compatibility fixes found no open PR covering this defect. #29335 changes omitted zero-major caret bounds, a separate issue.
Verification
macOS, Node 26.12.1, base
71646e031a6d.24.9.0against>= 24.0 < 24.10; the other eight tests pass.vp run check:changed origin/main --concurrency 2passed formatting, lint, both Knip checks, typechecks for 34 affected packages, and 10 tests in two selected files.toString()both accept24.9.0 / >= 24.0 < 24.10and22.16.0 / ^ 22.16 || >= 24.10, and both reject24.10.0 / >= 24.0 < 24.10. Main incorrectly rejects both valid examples.No live SSH host, WSL machine or provider installation was changed.