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(launcher): resolve Node for the npm diagnostic console - #1218
The native shell opens the diagnostic console by calling the Launcher directly. In an npm installation, the Launcher can receive no CODEXHOST_NPM_NODE_PATH or a path to a removed Node installation. npm packages have no bundled Node, so the Launcher can end up spawning a missing executable.
Keep the bundled or inherited absolute Node executable when available. For a confirmed npm distribution, resolve Node from PATH when those paths are unavailable. If Node cannot be found, report how to launch the console from a terminal with Node available.
Related issues
Refs #1200. The issue does not include the failed executable path. This PR covers the missing or stale npm Node path reproduced with an isolated install layout.
UI Demo
N/A (Launcher runtime selection).
Test plan
Reproduced CLI failure with a copied Launcher and an isolated npm layout containing no bundled Node.
cargo test --offline --locked -p codexhost-launcher --test cli passed all 12 tests on macOS. The regression covers absent and stale inherited Node paths and verifies that an installer missing its runtime still fails.
Windows cargo clippy --offline --locked -p codexhost-launcher --all-targets --target x86_64-pc-windows-msvc -- -D warnings, Cargo formatting, and git diff --check passed.
The Windows native-shell click path still needs verification on Windows.
The change lets the npm diagnostic console find Node on PATH when no bundled Node is available, and shows a clear message if Node is missing. No concrete merge-blocking risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
标题 "fix(launcher): resolve Node for the npm diagnostic console" 与变更集主要内容一致。变更新增了 npm 发行版判断函数,并在 run_console_command 中从 PATH 解析 node,还新增了相应的 CLI 测试。标题简洁、具体,能说明主要修改点。
Reviewing files that changed from the base of the PR and between 466d54c and e7047c4.
Files selected for processing: 3
crates/launcher/src/console.rs
crates/launcher/src/main.rs
crates/launcher/tests/cli.rs
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
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
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
The native shell opens the diagnostic console by calling the Launcher directly. In an npm installation, the Launcher can receive no
CODEXHOST_NPM_NODE_PATHor a path to a removed Node installation. npm packages have no bundled Node, so the Launcher can end up spawning a missing executable.Keep the bundled or inherited absolute Node executable when available. For a confirmed npm distribution, resolve Node from
PATHwhen those paths are unavailable. If Node cannot be found, report how to launch the console from a terminal with Node available.Related issues
Refs #1200. The issue does not include the failed executable path. This PR covers the missing or stale npm Node path reproduced with an isolated install layout.
UI Demo
N/A (Launcher runtime selection).
Test plan
cargo test --offline --locked -p codexhost-launcher --test clipassed all 12 tests on macOS. The regression covers absent and stale inherited Node paths and verifies that an installer missing its runtime still fails.cargo clippy --offline --locked -p codexhost-launcher --all-targets --target x86_64-pc-windows-msvc -- -D warnings, Cargo formatting, andgit diff --checkpassed.