File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
apps/sim/lib/copilot/client-sse Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -331,7 +331,11 @@ async function reportCompletion(
331331 headers : { 'Content-Type' : 'application/json' } ,
332332 body,
333333 } )
334- if ( ! res . ok && data && new Blob ( [ body ] ) . size > 1024 * 1024 ) {
334+ // Next.js silently truncates request bodies beyond its body size limit (default 10MB),
335+ // corrupting the JSON and causing a server-side parse error (500). When the request fails
336+ // and the payload is large, retry without the data to unblock the server-side waiter.
337+ const LARGE_PAYLOAD_THRESHOLD = 1024 * 1024
338+ if ( ! res . ok && data && new Blob ( [ body ] ) . size > LARGE_PAYLOAD_THRESHOLD ) {
335339 logger . warn ( '[RunTool] reportCompletion failed with large payload, retrying without data' , {
336340 toolCallId,
337341 status : res . status ,
You can’t perform that action at this time.
0 commit comments