Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(ssh): reconnecting no longer restarts the remote server #13521

Closedf4llenz(GitHub profile, opens in a new tab)wants to merge 5 commits intomain fromrefs/pull/13521/headopened View on GitHub

Showing 2 changed files with 142 additions and 2 deletions.

x
0 of 2 viewed, 2 left
139 additions and 1 deletionpackages/ssh/src/runnerProcess.test.tsModified
View file
@@ -11,7 +11,11 @@
import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
import * as NodeNet from "node:net";
​
-import { buildRemoteStopScript, buildRemoteT3RunnerScript } from "./tunnel.ts";
+import {
+ buildRemoteLaunchScript,
+ buildRemoteStopScript,
+ buildRemoteT3RunnerScript,
+} from "./tunnel.ts";
​
const Started = Schema.Struct({
pid: Schema.Number,
@@ -251,3 +255,137 @@
+​
+const LaunchResult = Schema.Struct({
+ remotePort: Schema.Number,
+ serverKind: Schema.Literals(["external", "managed"]),
+});
+const decodeLaunchResult = Schema.decodeUnknownSync(Schema.fromJsonString(LaunchResult));
+​
+// Stands in for `t3 serve`: answers the readiness probe and records itself in
+// the home's server-runtime.json, as every real server does.
+const FAKE_SERVER = `import * as fs from "node:fs";
+import * as http from "node:http";
+const flag = (name) => process.argv[process.argv.indexOf(name) + 1];