@devries-cameron20 / t3code Mirror · read-only / commits / 7aaf5ce21d
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 21, 19:45 UTC

fix(ssh): a failed remote t3 download says what failed and how to install it (#34928)

Julius Marminge committed Nov 12, 2026 at 00:08 UTC 7aaf5ce21d11ce352a6a2caa46d69060a997c68a
2 files changed +8 -2
packages/ssh/src/tunnel.test.ts
+4 -1
@@ -205,7 +205,7 @@ describe("ssh tunnel scripts", () => {
205 );
206 NodeFS.writeFileSync(
207 NodePath.join(bin, "curl"),
208 - "#!/bin/sh\necho 'download attempt' >&2\nexit 22\n",
208 + "#!/bin/sh\necho 'download attempt' >&2\necho 'curl: (6) Could not resolve host: github.com' >&2\nexit 6\n",
209 { mode: 0o755 },
210 );
211 const runner = NodePath.join(root, "run-t3.sh");
@@ -217,6 +217,9 @@ describe("ssh tunnel scripts", () => {
217 assert.notEqual(result.status, 0);
218 if (downloads) {
219 assert.include(result.stderr, "download attempt");
220 + // A bare curl error does not tell the user that t3 itself could not be downloaded.
221 + assert.include(result.stderr, ARCHIVE.archiveVersion);
222 + assert.include(result.stderr, "https://github.com/pingdotgg/t3code/releases/download");
223 } else {
224 assert.notInclude(result.stderr, "download attempt");
225 assert.include(result.stderr, "has no t3 release archive.");
packages/ssh/src/tunnel.ts
+4 -1
@@ -508,7 +508,10 @@ if ! t3_runtime_ready; then
508 if command -v curl >/dev/null 2>&1; then curl -fsSL --connect-timeout 30 --max-time "$3" "$1" -o "$2"
509 elif command -v wget >/dev/null 2>&1; then wget -q --timeout=30 --tries=1 "$1" -O "$2"
510 else printf 'Remote host needs curl or wget to download %s.\\n' "$T3_ARCHIVE" >&2; exit 1
511 - fi
511 + fi || {
512 + printf 'Could not download t3 %s from %s. If this host cannot reach it, install t3 %s on it with https://t3.codes/install.sh (T3CODE_VERSION=%s; T3CODE_RELEASE_BASE_URL selects a mirror).\\n' "$T3_ARCHIVE_VERSION" "$1" "$T3_ARCHIVE_VERSION" "$T3_ARCHIVE_VERSION" >&2
513 + exit 1
514 + }
515 }
516 t3_fetch "$T3_RELEASE_BASE_URL/v$T3_ARCHIVE_VERSION/SHA256SUMS" "$T3_STAGING/SHA256SUMS" @@T3_ARCHIVE_CHECKSUMS_SECONDS@@
517 t3_fetch "$T3_RELEASE_BASE_URL/v$T3_ARCHIVE_VERSION/$T3_ARCHIVE" "$T3_STAGING/$T3_ARCHIVE" @@T3_ARCHIVE_DOWNLOAD_SECONDS@@