can1357/oh-my-pi · warning
OpenAI Files API delete request failed
Error message
OpenAI Files API delete request failed
What it means
Thrown when the DELETE https://api.openai.com/v1/files/{id} request fails at the network level — fetch itself rejected (DNS, TLS, connection reset, abort). Like error 750, the original error is swallowed and replaced by this generic message; the API was never successfully reached.
Source
Thrown at packages/coding-agent/src/blob-broker/provider-files-openai.ts:138
method: "DELETE",
url: deleteUrl,
headers: { Authorization: authorization },
},
};
},
async delete(handle: ProviderFileHandle): Promise<void> {
if (handle.provider !== "openai" || typeof handle.id !== "string" || handle.id.trim().length === 0) {
throw new Error("Cannot delete an invalid OpenAI file handle");
}
let response: Response;
try {
response = await request(`${OPENAI_FILES_URL}/${encodeURIComponent(handle.id)}`, {
method: "DELETE",
headers: { Authorization: authorization },
});
} catch {
throw new Error("OpenAI Files API delete request failed");
}
if (!response.ok) {
throw new Error(`OpenAI Files API delete failed with HTTP ${response.status}`);
}
},
};
}
View on GitHub (pinned to 9690622007)
Solutions
- Confirm connectivity to api.openai.com (curl -X DELETE on the file URL with the key)
- Treat deletion as best-effort: catch, log, and retry later — leaked files can also be removed manually from the OpenAI dashboard
- Check proxy/firewall rules allow DELETE requests to api.openai.com
- Retry with backoff; deletions are idempotent (404 on retry is fine)
Example fix
// before: cleanup crashes on network blip
await client.delete(handle);
// after: best-effort deletion with retry
for (let attempt = 0; attempt < 3; attempt++) {
try { await client.delete(handle); return; }
catch (err) {
if (!String(err.message).includes("delete request failed")) throw err;
await Bun.sleep(2 ** attempt * 500);
}
}
logger.warn("openai file delete deferred; will retry", { id: handle.id }); Defensive patterns
Strategy: retry
Type guard
function isDeleteNetworkFailure(err: unknown): boolean {
return err instanceof Error && err.message === "OpenAI Files API delete request failed";
} Try / catch
try {
await client.delete(handle);
} catch (err) {
if (isDeleteNetworkFailure(err)) {
logger.warn("delete deferred (network); will retry", { id: handle.id });
queueRetry(() => client.delete(handle)); // deletions are safe to retry
} else throw err;
} Prevention
- Treat cleanup deletion as best-effort and queue retries
- Remember deletes are idempotent — a later 404 just means success
- Run cleanup jobs with connectivity checks / backoff
- Collect failed deletions for periodic reconciliation against the dashboard
When it happens
Trigger: client.delete() where fetch throws: offline machine, DNS failure, proxy refusal, TLS interception, or an AbortSignal (none is passed here, so mainly network faults) during the DELETE.
Common situations: Cleanup runs after the network dropped; background deletion job executing during a VPN outage; corporate proxy blocking DELETE to api.openai.com.
Related errors
- OpenAI Files API upload request failed
- V2 remote compaction failed (${response.status} ${response.s
- AnthropicConnectionError
- AnthropicConnectionTimeoutError
- xAI device-code request failed: ${error instanceof Error ? e
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/6de7dd14a66402fb.
Report an issue: GitHub.