File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
apps/sim/lib/copilot/client-sse Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -334,13 +334,14 @@ async function reportCompletion(
334334 // Next.js silently truncates request bodies beyond its body size limit (default 10MB),
335335 // corrupting the JSON and causing a server-side parse error (500). When the request fails
336336 // and the payload is large, retry without logs (the largest field) to fit under the limit.
337- const LARGE_PAYLOAD_THRESHOLD = 1024 * 1024
338- if ( ! res . ok && data && new Blob ( [ body ] ) . size > LARGE_PAYLOAD_THRESHOLD ) {
337+ const LARGE_PAYLOAD_THRESHOLD = 10 * 1024 * 1024
338+ const bodySize = new Blob ( [ body ] ) . size
339+ if ( ! res . ok && data && bodySize > LARGE_PAYLOAD_THRESHOLD ) {
339340 const { logs : _logs , ...dataWithoutLogs } = data
340341 logger . warn ( '[RunTool] reportCompletion failed with large payload, retrying without logs' , {
341342 toolCallId,
342343 status : res . status ,
343- bodySize : new Blob ( [ body ] ) . size ,
344+ bodySize,
344345 } )
345346 const retryRes = await fetch ( COPILOT_CONFIRM_API_PATH , {
346347 method : 'POST' ,
You can’t perform that action at this time.
0 commit comments