Skip to content

Commit d05f339

Browse files
committed
Sync from claude-code-action base-action@9f02f6f
Source: anthropics/claude-code-action@9f02f6f Original message: fix: Increase maxBuffer for jq processing to handle large Claude outputs (#473)
1 parent 452e077 commit d05f339

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/run-claude.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,10 @@ export async function runClaude(promptPath: string, options: ClaudeOptions) {
307307
await writeFile("output.txt", output);
308308

309309
// Process output.txt into JSON and save to execution file
310-
const { stdout: jsonOutput } = await execAsync("jq -s '.' output.txt");
310+
// Increase maxBuffer from Node.js default of 1MB to 10MB to handle large Claude outputs
311+
const { stdout: jsonOutput } = await execAsync("jq -s '.' output.txt", {
312+
maxBuffer: 10 * 1024 * 1024,
313+
});
311314
await writeFile(EXECUTION_FILE, jsonOutput);
312315

313316
console.log(`Log saved to ${EXECUTION_FILE}`);
@@ -324,7 +327,10 @@ export async function runClaude(promptPath: string, options: ClaudeOptions) {
324327
if (output) {
325328
try {
326329
await writeFile("output.txt", output);
327-
const { stdout: jsonOutput } = await execAsync("jq -s '.' output.txt");
330+
// Increase maxBuffer from Node.js default of 1MB to 10MB to handle large Claude outputs
331+
const { stdout: jsonOutput } = await execAsync("jq -s '.' output.txt", {
332+
maxBuffer: 10 * 1024 * 1024,
333+
});
328334
await writeFile(EXECUTION_FILE, jsonOutput);
329335
core.setOutput("execution_file", EXECUTION_FILE);
330336
} catch (e) {

0 commit comments

Comments
 (0)