orca icon indicating copy to clipboard operation
orca copied to clipboard

Support Nushell as a remote login shell for SSH relay Node.js detection

Open bioinformatist opened this issue 4 months ago • 2 comments

Problem

Orca SSH relay reports that Node.js is not installed on the remote host, even though node and npm are available on the remote PATH.

The remote user's login shell is Nushell. Since Nushell is not POSIX-compatible, Orca's Node.js detection appears to fail when it probes the remote host with POSIX shell syntax such as command -v node.

This may be related to #5097, but the symptom here is specifically the SSH relay bootstrap failing to detect an existing Node.js runtime.

Environment

  • Orca: v1.4.126
  • Client OS: Linux / NixOS
  • Remote OS: Linux / NixOS
  • Remote login shell: Nushell (nu)
  • Remote Node.js: v24.14.1
  • Remote npm: 11.11.0

Actual behavior

When connecting to the remote host through Orca SSH, the connection fails with:

Error invoking remote method 'ssh:connect': Error: Node.js not found on remote host. Orca relay requires Node.js 18+ and npm.

However, Node.js is present and usable on the remote host.

Reproduction / diagnostic commands

From the client host:

ssh user@remote 'command -v node'

With Nushell as the remote login shell, this fails because command is not a Nushell builtin:

Error: nu::shell::external_command
  x External command failed
   ,- [source:1:1]
 1 | command -v node
   : ^^^|^^^
   :    `-- Command `command` not found

But Node itself is available:

ssh user@remote 'node --version'
v24.14.1

And probing through a POSIX shell works:

ssh user@remote 'sh -lc "command -v node && node --version && command -v npm && npm --version"'
/etc/profiles/per-user/user/bin/node
v24.14.1
/etc/profiles/per-user/user/bin/npm
11.11.0

Expected behavior

Orca should support Nushell as a remote login shell for SSH relay setup and detect Node.js successfully when node and npm are available.

A clearer error message would help, but I think compatibility would be the better outcome here, since Nushell is a reasonable login shell for some users and the runtime itself is already installed.

Possible fix

From a quick look at the current remote Node resolution path, Orca resolves $SHELL and then runs command -v node through that shell. That works for POSIX-like shells and seems to have been improved for zsh/fish in #6037, but Nushell does not support command -v.

One possible approach would be to detect Nushell and use a Nushell-native probe such as which node, then validate the candidate with node --version. Another option may be to run the Node/npm detection through a known POSIX shell when available, while still preserving the existing login-shell behavior for shells where that is needed.

Notes

I can help test a fix on a NixOS remote where the login shell is Nushell and Node.js/npm are installed system-wide.

If you think this is worth supporting, I would also be happy to open a PR and try to implement it.

bioinformatist avatar Jul 07 '26 12:07 bioinformatist

Fixed in #23764. Manual test plan for anyone who wants to verify on a real Nushell remote:

  1. Set up (or use) a remote SSH host whose login shell is Nushell (nu), with Node.js 18+ and npm installed and resolvable via that login shell (which node works inside nu).
  2. Connect to that host through Orca's SSH relay setup flow.
  3. Expected (after fix): the relay detects Node.js successfully and completes bootstrap — no "Node.js not found on remote host" error.
  4. Regression check: repeat the same connection flow against a bash/zsh/fish/csh/tcsh remote to confirm those are unaffected (this PR's test suite already covers this at the unit level: src/main/ssh/ssh-remote-node-resolution.test.ts, 42/42 passing).

Automated coverage: one new unit test pins both halves of the fix (the -c flag selection and the Nushell-native which node | get path | first lookup) in the same assertion, alongside the existing fish//bin/sh/csh/tcsh cases, all passing unmodified.

Dacadev97 avatar Sep 29 '26 02:09 Dacadev97

Thanks @bioinformatist for the detailed diagnosis. The SSH relay is gone (#27214, #27215); SSH hosts now run Orca's managed remote server, which brings its own runtime, so there is no longer a host Node.js check, and its setup commands are wrapped to run under /bin/sh even when the login shell is not POSIX. Closing — please reopen if connecting to a Nushell host still fails on 1.4.224 or later.

OrcaWin avatar Oct 11 '26 06:10 OrcaWin