Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

fix(ssh): isolate managed tunnel processes (#4347)

Yukun Shan37ae1abbe947
diff --git a/packages/ssh/src/tunnel.test.ts b/packages/ssh/src/tunnel.test.ts
index 7e7a5a542..4c2ecb331 100644
--- a/packages/ssh/src/tunnel.test.ts
+++ b/packages/ssh/src/tunnel.test.ts
@@ -381,6 +381,11 @@ describe("ssh tunnel scripts", () => {
const first = yield* manager.ensureEnvironment(target);
assert.equal(first.httpBaseUrl, "http://127.0.0.1:41773/");
+ const firstTunnelArgs = spawnedCommands.find((args) => args.includes("-N"));
+ assert.isDefined(firstTunnelArgs);
+ assert.include(firstTunnelArgs, "ControlMaster=no");
+ assert.include(firstTunnelArgs, "ControlPath=none");
+ assert.include(firstTunnelArgs, "ControlPersist=no");
yield* manager.disconnectEnvironment(target);
assert.equal(tunnelKillCount, 1);
diff --git a/packages/ssh/src/tunnel.ts b/packages/ssh/src/tunnel.ts
index 016d5e9a8..179d1fcb5 100644
--- a/packages/ssh/src/tunnel.ts
+++ b/packages/ssh/src/tunnel.ts
@@ -963,6 +963,12 @@ const startSshTunnel = Effect.fn("ssh/tunnel.startSshTunnel")(function* (input:
"-o",
"ExitOnForwardFailure=yes",
"-o",
+ "ControlMaster=no",
+ "-o",
+ "ControlPath=none",
+ "-o",
+ "ControlPersist=no",
+ "-o",
"ServerAliveInterval=15",
"-o",
"ServerAliveCountMax=3",