Skip to content

fix(ssh): fix support for remotes that use fnm#2641

Open
soorria wants to merge 1 commit into
pingdotgg:mainfrom
soorria:fix/ssh-fnm-remotes
Open

fix(ssh): fix support for remotes that use fnm#2641
soorria wants to merge 1 commit into
pingdotgg:mainfrom
soorria:fix/ssh-fnm-remotes

Conversation

@soorria
Copy link
Copy Markdown

@soorria soorria commented May 11, 2026

Summary

  • Replace the remote SSH fnm bootstrap's invalid fnm env --shell sh usage with fnm env --shell bash.
  • Run fnm use once after environment initialization so remote Node resolution matches the one-shot activation pattern used for other version managers.
  • Update SSH tunnel script coverage to assert the new fnm activation commands.

Why

fnm env --shell sh is not a supported fnm shell value, so the existing remote bootstrap could silently fail to initialize fnm in non-interactive SSH sessions.

We also avoid fnm env --use-on-cd --shell sh because --use-on-cd emits hook code containing Bash-style [[ ... ]] conditionals, which are not supported by dash or POSIX sh. The remote runner is a #!/bin/sh script, so one-shot fnm use is a better fit than installing directory-change hooks.

Test Plan

  • bun --filter @t3tools/ssh test -- src/tunnel.test.ts
  • bun fmt && bun lint && bun typecheck

Made with Cursor


Note

Low Risk
Low risk: small, isolated change to the generated remote shell bootstrap for fnm, plus test expectation updates; main risk is behavior differences on systems where fnm env --shell bash isn’t available.

Overview
Fixes remote Node bootstrapping for hosts using fnm by replacing the unsupported fnm env --shell sh/--use-on-cd initialization with eval "$(fnm env --shell bash)" and then running a one-shot fnm use (--silent-if-unchanged with fallback to default).

Updates tunnel script tests to assert the new fnm activation and fnm use commands in the generated remote runner.

Reviewed by Cursor Bugbot for commit 7434d75. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix fnm support in SSH remote node path setup

The ensure_remote_node_path function in tunnel.ts previously tried to initialize fnm using sh with --use-on-cd but never called fnm use, so the correct Node version was not activated.

  • Now evaluates fnm env --shell bash and explicitly runs fnm use --silent-if-unchanged, falling back to fnm use default on failure.
  • All fnm invocations are silenced (>/dev/null 2>&1) and guarded to avoid errors on remotes where fnm is absent.
  • Behavioral Change: remotes using fnm will now have an active Node version on PATH where previously they did not.

Macroscope summarized 7434d75.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 11, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: db2a726c-3208-45a3-8442-adb48fcce8e8

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
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:XS 0-9 changed lines (additions + deletions). labels May 11, 2026
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented May 11, 2026

Approvability

Verdict: Approved

Straightforward bug fix modifying fnm shell initialization in SSH tunneling scripts. Limited scope, clear intent, and test coverage updated to match.

You can customize Macroscope's approvability policy. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS 0-9 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant