fix: upload-binary Content-Type fix, 429/timeout retry, 120s timeout - Remove Content-Type: application/json from uploadAssetBinary FormData request - Add retryOnTransient for 429 + timeout + signal timed out errors - Increase AI chat timeout from 60s to 120s per call - Apply retry logic to both chat() and visionChat()

This commit is contained in:
2026-06-02 16:58:59 +08:00
parent 9504f8ee87
commit 94c1453c9b
2 changed files with 75 additions and 42 deletions
+3 -1
View File
@@ -408,9 +408,11 @@ export const aiGenerationClient = {
form.append("file", blob, options?.name || "upload.png");
if (options?.scope) form.append("scope", options.scope);
if (options?.mimeType) form.append("mimeType", options.mimeType);
// Exclude Content-Type so browser auto-sets multipart/form-data with boundary
const { "Content-Type": _ct, ...authHeaders } = buildAuthHeaders();
const res = await fetch(buildApiUrl("oss/upload-binary"), {
method: "POST",
headers: { ...buildAuthHeaders() },
headers: authHeaders,
body: form,
});
if (!res.ok) {