fix(wp7-02): retry one transient image timeout
Dada P0-A isolated Windows CI / validate-and-package (push) Failing after 1m38s

This commit is contained in:
suyx
2026-08-04 17:22:26 +08:00
parent 8337906dd2
commit 0201c3e896
4 changed files with 66 additions and 37 deletions
@@ -285,6 +285,10 @@ export async function executeProviderRequest({ fetchImpl = fetch, modelConfig, p
} catch (error) {
if (error instanceof Error && /^WP7_02_[A-Z0-9_]+$/.test(error.message)) {
error.safe_response_shape = describeProviderResponseShape(providerResponse);
} else if (error instanceof Error && error.message === "image_output_media_invalid") {
throw new Error("WP7_02_RESPONSE_MEDIA_INVALID");
} else if (error instanceof Error && /^image_output_(?:aspect_ratio_mismatch|dimensions_missing|normalization_failed)$/.test(error.message)) {
throw new Error("WP7_02_RESPONSE_DIMENSIONS_INVALID");
}
throw error;
}