can1357/oh-my-pi · error · Error
Failed to download ${filename} (${repo}): HTTP ${response.st
Error message
Failed to download ${filename} (${repo}): HTTP ${response.status} What it means
downloadSherpaFile fetches raw model files from the Hugging Face resolve endpoint (https://huggingface.co/<repo>/resolve/main/<filename>) with redirect following. Any non-OK HTTP status or a missing response body aborts the download with this error, which names the file, the repo, and the HTTP status code.
Source
Thrown at packages/coding-agent/src/stt/asr-worker.ts:271
}
/**
* Stream a single sherpa-onnx model file from the Hub into the cache, writing to
* a `.part` sidecar and renaming on completion so an interrupted fetch never
* reads as cached. Emits coalesced per-file progress for the aggregating client.
*/
async function downloadSherpaFile(
repo: string,
filename: string,
dest: string,
modelKey: SttModelKey,
transport: SttTransport,
requestId: string,
): Promise<void> {
const url = `${HF_RESOLVE_BASE}/${repo}/resolve/main/${filename}`;
const response = await fetch(url, { redirect: "follow" });
if (!response.ok || !response.body) {
throw new Error(`Failed to download ${filename} (${repo}): HTTP ${response.status}`);
}
const total = Number(response.headers.get("content-length") ?? 0);
transport.send({
type: "progress",
id: requestId,
event: { modelKey, status: "download", name: `${repo}/${filename}`, file: filename },
});
const part = `${dest}.part`;
const handle = await fs.open(part, "w");
let loaded = 0;
let lastEmitted = 0;
const reader = response.body.getReader();
try {
for (;;) {
const { done, value } = await reader.read();
if (done) break;
if (!value) continue;
await handle.write(value);View on GitHub (pinned to 9690622007)
Solutions
- Check the reported HTTP status: 404 → verify the repo/filename still exists on Hugging Face; 401/403 → the repo may now be gated and require a token; 429 → wait and retry with backoff.
- Check network/proxy connectivity to huggingface.co.
- Retry the download later if it is a transient 5xx.
- Pin/switch to a different STT model tier whose repo is still available.
Defensive patterns
Strategy: retry
Validate before calling
const head = await fetch(url, { method: "HEAD", redirect: "follow" });
if (!head.ok) throw new Error(`model file unavailable: ${url} (HTTP ${head.status})`); Try / catch
try { await downloadSherpaFile(...); } catch (err) { if (/HTTP (429|5..)/.test(String(err))) await Bun.sleep(backoff); /* retry with exponential backoff */ else throw err; } Prevention
- Verify the HF repo/file still exists before pinning a model tier.
- Handle 429 with exponential backoff for rate limits.
- Configure proxy/token settings if downloads happen in gated or corporate networks.
When it happens
Trigger: Downloading a sherpa model file when Hugging Face returns 404 (file/repo renamed or removed), 401/403 (gated repo), 429 (rate limit), or 5xx, or when the response has no body stream.
Common situations: Model repo moved or deprecated upstream, corporate proxy/firewall intercepting the request, Hugging Face rate limiting, or offline/broken DNS causing an error page status.
Related errors
- Failed to download ${model} ${fileName} from ${repo}: ${resp
- Browser download failed (${response.status} ${response.statu
- V2 remote compaction failed (${response.status} ${response.s
- sso-role
- HTTP request failed. status=${response.status}; url=${url};
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/2f5bf16dc46ef677.
Report an issue: GitHub.