Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(ssh): isolate managed tunnel processes #4347

MergednateEc(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/4347/headmerged by maria-rcks View on GitHub

Closes #3533

Summary

  • disable OpenSSH connection multiplexing for T3-managed local-forward processes
  • prevent inherited ControlMaster auto / ControlPersist settings from making the supervised tunnel exit immediately
  • leave ordinary SSH commands and the user's SSH config unchanged

Verification

  • ./node_modules/.bin/vp test run packages/ssh/src/tunnel.test.ts (12 passed)
  • ./node_modules/.bin/vp run --filter @t3tools/ssh typecheck
  • targeted lint and formatting for the changed files

Note

Low Risk Narrow change to tunnel ssh argv plus test assertions; no auth, config file, or non-tunnel SSH behavior changes.

Overview Managed SSH local-forward tunnels now pass explicit -o ControlMaster=no, ControlPath=none, and ControlPersist=no when spawning the supervised ssh -N -L … process in startSshTunnel.

That prevents a user’s global SSH config (e.g. ControlMaster auto / ControlPersist) from attaching the tunnel to an existing multiplexed session, which could make the supervised process exit right away and break T3’s tunnel lifecycle.

Only the tunnel spawn argv changes; other SSH command paths are untouched. A test asserts the first tunnel command includes these three options after ensureEnvironment.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 427ab70f8be8827eeedd1cc0900f644d06ef3e56. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Disable SSH connection multiplexing for managed tunnel processes

Adds -o ControlMaster=no -o ControlPath=none -o ControlPersist=no to the SSH command in tunnel.ts to prevent managed tunnel processes from sharing or inheriting existing SSH control sockets. This isolates each tunnel process from ambient SSH multiplexing that could interfere with tunnel behavior.

Macroscope summarized 427ab70.
    1. 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 Plus

      Run ID: feee8a58-0ad9-47c5-9d79-f4ec3757efd9

      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

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Approvability

      Verdict: Approved

      This PR adds standard SSH options (ControlMaster=no, ControlPath=none, ControlPersist=no) to isolate managed tunnel processes. The change is small, additive, follows existing patterns, and includes test coverage.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. maria-rcks merged this37ae1ab

    5. maria-rcks closed this

Sign in to join this conversation.