Fix 10mb tool response limit

This commit is contained in:
Siddharth Ganesan
2026-04-06 16:13:11 -07:00
parent ca2afaa5a2
commit 8dfbe8ae3f

View File

@@ -356,9 +356,6 @@ async function reportCompletion(
headers: { 'Content-Type': 'application/json' },
body,
})
// Next.js silently truncates request bodies beyond its body size limit (default 10MB),
// corrupting the JSON and causing a server-side parse error (500). When the request fails
// and the payload is large, retry without logs (the largest field) to fit under the limit.
const LARGE_PAYLOAD_THRESHOLD = 10 * 1024 * 1024
const bodySize = new Blob([body]).size
if (!res.ok && data && bodySize > LARGE_PAYLOAD_THRESHOLD) {