Skip to content

Commit 7f7c2bc

Browse files
fix(image-gen): use 64 MiB JSON cap + mode-dependent label
P1: Image responses carry base64-encoded image data that can exceed the default 16 MiB provider JSON cap (4 images × ~7 MiB base64 each = ~28 MiB). Pass a 64 MiB cap to readProviderJsonResponse. P3: Use mode-dependent label for bounded-read errors, matching the pattern already used by assertOkOrThrowHttpError in the same function. Co-Authored-By: Claude <[email protected]>
1 parent 1cd82a7 commit 7f7c2bc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/image-generation/openai-compatible-image-provider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ export function createOpenAiCompatibleImageGenerationProvider(
272272
);
273273
const parsedBody = await readProviderJsonResponse(
274274
response,
275-
`${options.label} image generation`,
275+
mode === "edit" ? `${options.label} image edit` : `${options.label} image generation`,
276+
{ maxBytes: 64 * 1024 * 1024 },
276277
);
277278
const images = parseOpenAiCompatibleImageResponse(parsedBody, {
278279
...options.response,

0 commit comments

Comments
 (0)