Repository navigation
fix(ssh): select a complete Node/npm toolchain for the relay - #9165
Merged
Merged
Conversation
Contributor
📝 WalkthroughWalkthroughRemote Node resolution now validates both Node and npm versions for POSIX and Windows candidates. New probe builders configure the appropriate PATH, execute Node and npm version commands, and parse marker-based output with legacy Node-only compatibility. Resolver tests cover rejection of an incomplete system Node installation and selection of a complete NVM toolchain. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
brennanb2025
added a commit
that referenced
this pull request
Jul 18, 2026
… (#9255) * fix(ssh): probe npm via prepended PATH, not colocated with node (#9165) The remote Node/npm toolchain gate invoked npm by its absolute path <nodeBinDir>/npm (POSIX) / npm.cmd (Windows, behind a Test-Path colocation check). But deploy (commandWithNodePath) runs bare `npm` with nodeBinDir merely prepended to PATH, so npm can resolve from anywhere on PATH. A host whose only resolvable node has npm elsewhere on PATH (e.g. node symlinked into a dir without npm) deployed fine on v1.4.144, but after upgrade the candidate is rejected with no fallback → SSH/relay connection fails to establish. Make the probe resolve npm exactly the way deploy does — bare `npm --version` under the same prepended PATH — so it still confirms npm is runnable (the #8450 concern) without requiring colocation. Windows now prepends the backslash-form dir (matching deploy) so bare-command PATH lookup resolves reliably. * test(ssh): cover split Node npm PATH resolution
6 tasks
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
enrick-dev
pushed a commit
to enrick-dev/orca
that referenced
this pull request
Oct 15, 2026
…lyai#9165) (stablyai#9255) * fix(ssh): probe npm via prepended PATH, not colocated with node (stablyai#9165) The remote Node/npm toolchain gate invoked npm by its absolute path <nodeBinDir>/npm (POSIX) / npm.cmd (Windows, behind a Test-Path colocation check). But deploy (commandWithNodePath) runs bare `npm` with nodeBinDir merely prepended to PATH, so npm can resolve from anywhere on PATH. A host whose only resolvable node has npm elsewhere on PATH (e.g. node symlinked into a dir without npm) deployed fine on v1.4.144, but after upgrade the candidate is rejected with no fallback → SSH/relay connection fails to establish. Make the probe resolve npm exactly the way deploy does — bare `npm --version` under the same prepended PATH — so it still confirms npm is runnable (the stablyai#8450 concern) without requiring colocation. Windows now prepends the backslash-form dir (matching deploy) so bare-command PATH lookup resolves reliably. * test(ssh): cover split Node npm PATH resolution
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.
Problem
On SSH/relay hosts, system
/usr/bin/nodecould be selected without an accompanyingnpm, so the relay'snpm installsilently skipped thenode-ptynative build (lifecycle scripts blocked under nvm-managed npm) — leaving terminals broken on the remote. (Reported in #8450; the closely-related #8720 was already resolved onmainvia #8686.)Fix
Adds a Node/npm toolchain probe (
ssh-remote-node-toolchain-probe.ts) and requires a coherent colocated Node+npm toolchain, skipping incomplete system-Node candidates on both POSIX and Windows so a usable toolchain is chosen.Validation
104 focused SSH tests pass (5 skipped), typecheck + targeted lint/format clean, regression-proof (tests fail with the fix reverted).
Fixes #8450
Manual validation
brennanb2025/bug-8720-triage./usr/bin/nodev18.19.1 with no npm, while an NVM install below the standard.bashrcnon-interactive guard provided Node v22.23.1 + npm 10.9.8.Found node via path probe: /root/.nvm/versions/node/v22.23.1/bin/node, installed native dependencies, and started the relay.demo-project; backing SSH checks confirmed the proof file, Git status, the relay daemon running under the NVM Node, and successfulrequire("node-pty")+require("@parcel/watcher").node:22-bookwormhost: Orca retained/usr/local/bin/node+/usr/local/bin/npm, native dependencies loaded, and a real remote-terminal repository action succeeded.Reliability invariant: an SSH relay bootstrap must reject a Node candidate without a colocated runnable npm, then preserve a native-backed remote PTY that accepts input and renders output. The oracle was visible terminal output plus remote process, file, Git, and native-module checks; this live
test-orca-sshevidence covers a macOS client against Linux arm64, while Linux/Windows desktop clients, WSL, and a Windows SSH target remain unexercised live (focused automated PowerShell coverage remains in the PR).Evidence
Broken-system-Node host: the same terminal shows the original non-interactive
/usr/bin/node+ missing npm state, followed by Orca's selected NVM Node/npm pair and a successful remote repo action.Normal host: the relay retains the standard colocated
/usr/local/bin/node+ npm toolchain and the remote repo action succeeds.