From 9f02f6f6d43ec1d1da0f80028250535a057f3f32 Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Wed, 20 Aug 2025 20:02:00 -0700 Subject: [PATCH] fix: Increase maxBuffer for jq processing to handle large Claude outputs (#473) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes "stdout maxBuffer length exceeded" error by increasing the buffer from Node.js default of 1MB to 10MB when processing Claude output with jq. This prevents failures when Claude produces large execution logs. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude --- base-action/src/run-claude.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/base-action/src/run-claude.ts b/base-action/src/run-claude.ts index 0edfa72..1d095b7 100644 --- a/base-action/src/run-claude.ts +++ b/base-action/src/run-claude.ts @@ -307,7 +307,10 @@ export async function runClaude(promptPath: string, options: ClaudeOptions) { await writeFile("output.txt", output); // Process output.txt into JSON and save to execution file - const { stdout: jsonOutput } = await execAsync("jq -s '.' output.txt"); + // Increase maxBuffer from Node.js default of 1MB to 10MB to handle large Claude outputs + const { stdout: jsonOutput } = await execAsync("jq -s '.' output.txt", { + maxBuffer: 10 * 1024 * 1024, + }); await writeFile(EXECUTION_FILE, jsonOutput); console.log(`Log saved to ${EXECUTION_FILE}`); @@ -324,7 +327,10 @@ export async function runClaude(promptPath: string, options: ClaudeOptions) { if (output) { try { await writeFile("output.txt", output); - const { stdout: jsonOutput } = await execAsync("jq -s '.' output.txt"); + // Increase maxBuffer from Node.js default of 1MB to 10MB to handle large Claude outputs + const { stdout: jsonOutput } = await execAsync("jq -s '.' output.txt", { + maxBuffer: 10 * 1024 * 1024, + }); await writeFile(EXECUTION_FILE, jsonOutput); core.setOutput("execution_file", EXECUTION_FILE); } catch (e) {