@devries-cameron20 / t3code-1 / commits / b2078c2d0a
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): service launcher keeps a T3 home that ends in a space (#35958)

Julius Marminge committed Nov 12, 2026 at 20:38 UTC b2078c2d0a944119f9c854bf0f4769bd6d148f3a
2 files changed +32 -2
apps/server/src/serviceLauncher.test.ts
+30
@@ -392,6 +392,36 @@ process.exit(0);
392 }),
393 );
394
395 + it.effect("starts the runtime in a T3 home whose name ends in a space", () =>
396 + Effect.gen(function* () {
397 + const fs = yield* FileSystem.FileSystem;
398 + const path = yield* Path.Path;
399 + const parent = yield* fs.makeTempDirectoryScoped({ prefix: "t3-service-launcher-space-" });
400 + const root = path.join(parent, "T3 data ");
401 + const versionDir = path.join(root, "runtime", "versions", "1.0.0");
402 + yield* writeFakeRuntime(
403 + fs,
404 + path,
405 + versionDir,
406 + `
407 +import { writeFileSync } from "node:fs";
408 +writeFileSync(new URL("./started", import.meta.url), "");
409 +process.exit(0);
410 +`,
411 + );
412 + yield* fs.writeFileString(
413 + path.join(root, "runtime", "service-state.json"),
414 + JSON.stringify({ protocol: 4, activeVersion: "1.0.0" }),
415 + );
416 +
417 + yield* Effect.promise(() =>
418 + expect(runLauncher(root)).rejects.toThrow("Active child exited unexpectedly (0)."),
419 + );
420 +
421 + assert.isTrue(yield* fs.exists(path.join(versionDir, "started")));
422 + }),
423 + );
424 +
425 it.effect("refuses non-install legacy documents without rewriting or spawning", () =>
426 Effect.gen(function* () {
427 const fs = yield* FileSystem.FileSystem;
apps/server/src/serviceLauncher.ts
+2 -2
@@ -1375,8 +1375,8 @@ export interface LauncherOptions {
1375 }
1376
1377 export async function main(options: LauncherOptions = {}): Promise<void> {
1378 - const baseDir = (options.baseDir ?? process.env.T3CODE_HOME)?.trim();
1379 - if (baseDir === undefined || baseDir === "") {
1378 + const baseDir = options.baseDir ?? process.env.T3CODE_HOME;
1379 + if (baseDir === undefined || baseDir.trim() === "") {
1380 throw new Error("T3CODE_HOME is required by the T3 Code service launcher.");
1381 }
1382 const output =