fix: sanitize oversized image payloads

This commit is contained in:
Peter Steinberger
2026-01-18 15:19:25 +00:00
parent 891a2cc64a
commit 9c06689569
10 changed files with 208 additions and 17 deletions

View File

@@ -23,5 +23,10 @@ describe("isCloudCodeAssistFormatError", () => {
});
it("ignores unrelated errors", () => {
expect(isCloudCodeAssistFormatError("rate limit exceeded")).toBe(false);
expect(
isCloudCodeAssistFormatError(
"400 {\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"messages.84.content.1.image.source.base64.data: At least one of the image dimensions exceed max allowed size for many-image requests: 2000 pixels\"}}",
),
).toBe(false);
});
});