@devries-cameron20 / t3code-1 / commits / 56064fc4f6
Fork 0

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

fix(ssh): Intel Mac hosts no longer try to download a missing t3 archive (#33325)

Julius Marminge committed Nov 10, 2026 at 00:18 UTC 56064fc4f6f376af29d4cd5831714fe06b26fe42
3 files changed +55 -11
packages/shared/src/cliRelease.ts
+2 -1
@@ -8,7 +8,8 @@ export const CLI_RELEASES_PAGE_URL = `https://github.com/${CLI_RELEASE_REPOSITOR
8 export const CLI_RELEASE_CHECKSUMS_FILE = "SHA256SUMS";
9 export const CLI_RELEASE_BASE_URL_ENV = "T3CODE_RELEASE_BASE_URL";
10
11 -// Keep archive keys aligned with the Linux matrix, Windows ARM64 build, and cli_archive rows in release.yml.
11 +// Keep archive keys aligned with the Linux matrix, Windows ARM64 build, and cli_archive rows in release.yml,
12 +// and with the SSH runner's host check in packages/ssh/src/tunnel.ts.
13 // Node single-executables do not support darwin-x64 and segfault at startup.
14 const CLI_ARCHIVE_PLATFORM_KEYS = [
15 "darwin-arm64",
packages/ssh/src/tunnel.test.ts
+46
@@ -1,3 +1,9 @@
1 +// @effect-diagnostics nodeBuiltinImport:off - Runs the generated runner in a real shell.
2 +import * as NodeChildProcess from "node:child_process";
3 +import * as NodeFS from "node:fs";
4 +import * as NodeOS from "node:os";
5 +import * as NodePath from "node:path";
6 +
7 import { assert, describe, it } from "@effect/vitest";
8 import * as NodeCrypto from "@effect/platform-node/NodeCrypto";
9 import * as NodeServices from "@effect/platform-node/NodeServices";
@@ -109,6 +115,46 @@ describe("ssh tunnel scripts", () => {
115 );
116 });
117
118 + it.each([
119 + { host: "Darwin x86_64", system: "Darwin", machine: "x86_64", downloads: false },
120 + { host: "Darwin arm64", system: "Darwin", machine: "arm64", downloads: true },
121 + ])(
122 + "only downloads a release archive the host can run: $host",
123 + ({ system, machine, downloads }) => {
124 + const root = NodeFS.mkdtempSync(NodePath.join(NodeOS.tmpdir(), "t3-ssh-runner-"));
125 + try {
126 + const bin = NodePath.join(root, "bin");
127 + NodeFS.mkdirSync(bin);
128 + NodeFS.mkdirSync(NodePath.join(root, "home"));
129 + NodeFS.writeFileSync(
130 + NodePath.join(bin, "uname"),
131 + `#!/bin/sh\ncase "$1" in -s) echo ${system} ;; -m) echo ${machine} ;; esac\n`,
132 + { mode: 0o755 },
133 + );
134 + NodeFS.writeFileSync(
135 + NodePath.join(bin, "curl"),
136 + "#!/bin/sh\necho 'download attempt' >&2\nexit 22\n",
137 + { mode: 0o755 },
138 + );
139 + const runner = NodePath.join(root, "run-t3.sh");
140 + NodeFS.writeFileSync(runner, SshTunnel.buildRemoteT3RunnerScript(ARCHIVE));
141 + const result = NodeChildProcess.spawnSync("sh", [runner, "--version"], {
142 + encoding: "utf8",
143 + env: { HOME: NodePath.join(root, "home"), PATH: `${bin}:${process.env.PATH ?? ""}` },
144 + });
145 + assert.notEqual(result.status, 0);
146 + if (downloads) {
147 + assert.include(result.stderr, "download attempt");
148 + } else {
149 + assert.notInclude(result.stderr, "download attempt");
150 + assert.include(result.stderr, "has no t3 release archive.");
151 + }
152 + } finally {
153 + NodeFS.rmSync(root, { recursive: true, force: true });
154 + }
155 + },
156 + );
157 +
158 it.effect("accepts launch JSON after remote shell startup noise", () => {
159 const target = {
160 alias: "devbox",
packages/ssh/src/tunnel.ts
+7 -10
@@ -480,17 +480,14 @@ if ! t3_runtime_ready; then
480 trap 'rm -rf "$T3_LOCK"' EXIT
481 fi
482 if ! t3_runtime_ready; then
483 - case "$(uname -s)" in
484 - Darwin) T3_PLATFORM="darwin" ;;
485 - Linux) T3_PLATFORM="linux" ;;
486 - *) printf 'Remote host %s has no t3 release archive.\\n' "$(uname -s)" >&2; exit 1 ;;
483 + # Keep aligned with CLI_ARCHIVE_PLATFORM_KEYS in packages/shared/src/cliRelease.ts.
484 + case "$(uname -s) $(uname -m)" in
485 + "Darwin arm64") T3_PLATFORM_KEY="darwin-arm64" ;;
486 + "Linux arm64" | "Linux aarch64") T3_PLATFORM_KEY="linux-arm64" ;;
487 + "Linux x86_64" | "Linux amd64") T3_PLATFORM_KEY="linux-x64" ;;
488 + *) printf 'Remote host %s has no t3 release archive.\\n' "$(uname -s) $(uname -m)" >&2; exit 1 ;;
489 esac
488 - case "$(uname -m)" in
489 - arm64 | aarch64) T3_ARCH="arm64" ;;
490 - x86_64 | amd64) T3_ARCH="x64" ;;
491 - *) printf 'Remote host %s has no t3 release archive.\\n' "$(uname -m)" >&2; exit 1 ;;
492 - esac
493 - T3_ARCHIVE="t3-$T3_ARCHIVE_VERSION-$T3_PLATFORM-$T3_ARCH.tar.gz"
490 + T3_ARCHIVE="t3-$T3_ARCHIVE_VERSION-$T3_PLATFORM_KEY.tar.gz"
491 T3_STAGING="$(mktemp -d "$HOME/.t3/runtime/versions/.staging-XXXXXX")"
492 trap 'rm -rf "$T3_STAGING" "$T3_LOCK"' EXIT
493 t3_fetch() {