earendil-works/pi · error · Error

Could not download managed installer

Error message

Could not download managed installer ${label} from ${url}: HTTP ${response.status}

What it means

Thrown by fetchInstallerArtifact when the HTTP response for an installer artifact has a non-OK status. The printed status code indicates why the download URL failed (e.g. 404 for a missing release asset, 403 rate limiting, 5xx server error).

Solutions

  1. Retry the update later if the status is transient (5xx, rate limiting)
  2. Check network connectivity and any proxy configuration
  3. If 404, verify the release version and asset exist on the distribution server
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/coding-agent/src/package-manager-cli.ts:84 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24). Data as JSON: /api/errors/d030b5bd330e6488. Report an issue: GitHub.

Appendix: source

Thrown at packages/coding-agent/src/package-manager-cli.ts:84

		const marker = JSON.parse(readFileSync(markerPath, "utf8")) as {
			kind?: unknown;
			layout?: unknown;
			schemaVersion?: unknown;
		};
		if (marker.kind !== "pi-managed-install" || marker.schemaVersion !== 1 || marker.layout !== "releases-v1") {
			throw new Error();
		}
	} catch {
		throw new Error(`Managed install marker is missing or invalid: ${markerPath}`);
	}

	return managedRoot;
}

async function fetchInstallerArtifact(url: string, label: string): Promise<string> {
	const response = await fetch(url, { headers: { "User-Agent": getPiUserAgent(VERSION) } });
	if (!response.ok) {
		throw new Error(`Could not download managed installer ${label} from ${url}: HTTP ${response.status}`);
	}
	return await response.text();
}

async function runManagedNpmCi(stageDir: string): Promise<void> {
	const args = [
		"ci",
		"--ignore-scripts",
		"--min-release-age=0",
		"--omit=dev",
		"--include=optional",
		"--no-fund",
		"--no-audit",
		"--loglevel=error",
		"--progress=false",
	];
	const code = await waitForChildProcess(spawnProcess("npm", args, { cwd: stageDir, stdio: "inherit" }));
	if (code !== 0) throw new Error(`npm ${args.join(" ")} exited with code ${code ?? "unknown"}`);

View on GitHub (pinned to 4af9d21d3b)