earendil-works/pi · error · Error
Failed to download
Error message
Failed to download: ${response.status} What it means
downloadFile received a non-OK status when fetching the tool binary; the message embeds the HTTP status to identify why the download failed.
Solutions
- Retry the download for transient server errors
- Verify the asset URL/version exists on the release page
- Check network and proxy configuration
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at packages/coding-agent/src/utils/tools-manager.ts:129 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/e308e59fc05abc93.
Report an issue: GitHub.
Appendix: source
Thrown at packages/coding-agent/src/utils/tools-manager.ts:129
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");
}
const fileStream = createWriteStream(dest);
await pipeline(Readable.fromWeb(response.body as any), fileStream);
}
function findBinaryRecursively(rootDir: string, binaryFileName: string): string | null {
const stack: string[] = [rootDir];
while (stack.length > 0) {
const currentDir = stack.pop();
if (!currentDir) continue;
const entries = readdirSync(currentDir, { withFileTypes: true });View on GitHub (pinned to 4af9d21d3b)