@devries-cameron20 / t3code Mirror · read-only / commits / 88c69ffff6
Fork 0

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

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 24, 20:15 UTC

fix(server): parse CLI version in update preflight (#4389)

Theo Browne committed Jul 23, 2026 at 12:58 UTC 88c69ffff6ca3a025eec6a2ea597d4048e851266
2 files changed +6 -4
apps/server/src/cloud/selfUpdate.test.ts
+2 -2
@@ -54,7 +54,7 @@ const makeRecordingRunnerLayer = (
54 return {
55 stdout:
56 options?.stdoutFor?.(input.command, input.args) ??
57 - (versionFromPath === undefined ? "" : `${versionFromPath}\n`),
57 + (versionFromPath === undefined ? "" : `t3 v${versionFromPath}\n`),
58 stderr: failed ? `${input.command} exploded` : "",
59 code: ChildProcessSpawner.ExitCode(failed ? 1 : 0),
60 timedOut: false,
@@ -427,7 +427,7 @@ it.layer(NodeServices.layer)("ServerSelfUpdate.update", (it) => {
427 Effect.gen(function* () {
428 const context = yield* makeContext({
429 stdoutFor: (command, args) =>
430 - command === NODE_PATH && args[1] === "--version" ? "0.0.28\n" : undefined,
430 + command === NODE_PATH && args[1] === "--version" ? "t3 v0.0.28\n" : undefined,
431 });
432 const versionDir = context.path.join(context.baseDir, "runtime", "versions", "0.0.29");
433
apps/server/src/cloud/selfUpdate.ts
+4 -2
@@ -273,8 +273,10 @@ export const make = Effect.fn("cloud.server_self_update.make")(function* (option
273 failWith(`Could not verify the installed t3@${targetVersion}.`, cause),
274 ),
275 );
276 - const preflightVersion = preflight.stdout.trim();
277 - if (preflight.code !== 0 || preflightVersion !== targetVersion) {
276 + // Effect CLI's unstable formatVersion currently emits `${name} v${version}`.
277 + // Extract the version token so surrounding presentation changes do not break updates.
278 + const reportedVersion = /\bv(\S+)\s*$/.exec(preflight.stdout)?.[1];
279 + if (preflight.code !== 0 || reportedVersion !== targetVersion) {
280 // A completed npm install can still be unusable under this Node or on
281 // this machine. Remove its sentinel and tree so a retry of the same
282 // version performs a clean install instead of reusing a known-bad one.