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

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

fix(install): name the archive when its download fails (#35854)

Julius Marminge committed Nov 12, 2026 at 19:28 UTC 0fa18ad7125f2bfd433bd15467eddd443bdae103
2 files changed +53 -1
scripts/install.sh
+1 -1
@@ -248,7 +248,7 @@ else
248 fi
249 expected="$(grep " \*\{0,1\}${archive}\$" "${staging}/SHA256SUMS" | cut -d' ' -f1)"
250 [ -n "$expected" ] || fail "t3 ${version} has no release archive for ${platform}-${arch}"
251 - download "${base_url}/v${version}/${archive}" "${staging}/${archive}"
251 + download "${base_url}/v${version}/${archive}" "${staging}/${archive}" || fail "could not download ${archive}"
252
253 step "Verifying the download..."
254 actual="$(checksum "${staging}/${archive}")"
scripts/install.test.ts
+52
@@ -130,6 +130,58 @@ describe.skipIf(HostProcess.Platform.defaultValue() !== "linux")("installer chan
130 });
131 });
132
133 +// regression: #35834
134 +describe.skipIf(HostProcess.Platform.defaultValue() !== "linux")(
135 + "installer archive download",
136 + () => {
137 + it("names the archive when it returns 404", async () => {
138 + const root = await NodeFSP.mkdtemp(NodePath.join(NodeOS.tmpdir(), "t3-install-archive-"));
139 + const arch = HostProcess.Architecture.defaultValue() === "arm64" ? "arm64" : "x64";
140 + const archive = `t3-1.2.3-linux-${arch}.tar.gz`;
141 + const server = NodeHttp.createServer((request, response) => {
142 + if (request.url === "/v1.2.3/SHA256SUMS")
143 + return response.end(`${"0".repeat(64)} ${archive}\n`);
144 + response.writeHead(404).end();
145 + });
146 + try {
147 + await new Promise<void>((resolve) => server.listen(0, "127.0.0.1", resolve));
148 + const address = server.address();
149 + if (!address || typeof address === "string") throw new Error("Expected a TCP listener");
150 + const { code, output } = await new Promise<{ code: number | null; output: string }>(
151 + (resolve, reject) => {
152 + const child = NodeChildProcess.spawn(
153 + "sh",
154 + [NodePath.resolve(import.meta.dirname, "install.sh")],
155 + {
156 + env: {
157 + ...process.env,
158 + T3CODE_CHANNEL: "",
159 + T3CODE_VERSION: "1.2.3",
160 + T3CODE_HOME: NodePath.join(root, "home"),
161 + T3CODE_INSTALL_BIN_DIR: NodePath.join(root, "bin"),
162 + T3CODE_RELEASE_BASE_URL: `http://127.0.0.1:${address.port}`,
163 + },
164 + stdio: ["ignore", "pipe", "pipe"],
165 + },
166 + );
167 + let output = "";
168 + child.stdout.on("data", (chunk: Buffer) => (output += chunk.toString()));
169 + child.stderr.on("data", (chunk: Buffer) => (output += chunk.toString()));
170 + child.on("error", reject);
171 + child.on("close", (code) => resolve({ code, output }));
172 + },
173 + );
174 + expect(code, output).not.toBe(0);
175 + expect(output).toMatch(new RegExp(`t3 install: .*${archive.replaceAll(".", "\\.")}`));
176 + } finally {
177 + server.closeAllConnections();
178 + await new Promise<void>((resolve) => server.close(() => resolve()));
179 + await NodeFSP.rm(root, { recursive: true, force: true });
180 + }
181 + });
182 + },
183 +);
184 +
185 /** Runs an installer for a version that is already unpacked, so only the t3 command step runs. */
186 async function installOver(input: {
187 readonly script: "install.sh" | "install.ps1";