earendil-works/pi · error · Error

GitHub API error

Error message

GitHub API error: ${response.status}

What it means

Thrown by getLatestVersion in the tools manager when the GitHub releases API responds with a non-OK HTTP status, so the latest release tag for the tool repository cannot be read. Common causes are rate limiting (403), missing repo (404), or GitHub downtime.

Solutions

  1. Retry after GitHub rate limits reset (check X-RateLimit headers)
  2. Check network connectivity and proxy settings
  3. Pre-install fd/rg manually so no GitHub lookup is needed
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at packages/coding-agent/src/utils/tools-manager.ts:117 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/dc2dd9eb7f84cedd. Report an issue: GitHub.

Appendix: source

Thrown at packages/coding-agent/src/utils/tools-manager.ts:117

			return systemBinaryName;
		}
	}

	return null;
}

// Fetch latest release version from GitHub
async function getLatestVersion(repo: string): Promise<string> {
	const response = await fetchWithRetry(
		`https://api.github.com/repos/${repo}/releases/latest`,
		{
			headers: { "User-Agent": `${APP_NAME}-coding-agent` },
		},
		{ timeoutMs: NETWORK_TIMEOUT_MS },
	);

	if (!response.ok) {
		throw new Error(`GitHub API error: ${response.status}`);
	}

	const data = (await response.json()) as { tag_name: string };
	return data.tag_name.replace(/^v/, "");
}

// Download a file from URL
async function downloadFile(url: string, dest: string): Promise<void> {
	const response = await fetchWithRetry(url, undefined, { timeoutMs: DOWNLOAD_TIMEOUT_MS });

	if (!response.ok) {
		throw new Error(`Failed to download: ${response.status}`);
	}

	if (!response.body) {
		throw new Error("No response body");
	}

View on GitHub (pinned to 4af9d21d3b)