You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add filterCILogs() to extract only relevant error information
- Show concise error summary instead of dumping raw logs
- Truncate logs to 2000 chars to avoid context warnings
- Simplify prompts to reduce token usage
- Add SIGINT handlers to properly handle Ctrl+C
- Add debug output showing Claude command flags
constfixPrompt=`Fix CI failures for commit ${currentSha.substring(0,7)} in ${owner}/${repo}.
3352
3358
3353
-
IMPORTANT:
3354
-
- Be direct and apply fixes immediately
3355
-
- Don't ask for clarification or permission
3356
-
- Make all necessary file changes to fix the CI
3357
-
- If multiple issues exist, fix them all
3359
+
Error logs:
3360
+
${truncatedLogs}
3358
3361
3359
-
Fix all CI failures now by making the necessary changes.`
3362
+
Fix all issues by making necessary file changes. Be direct, don't ask questions.`
3360
3363
3361
3364
// Run Claude non-interactively to apply fixes
3362
3365
log.substep('Applying CI fixes...')
@@ -3415,11 +3418,20 @@ Fix all CI failures now by making the necessary changes.`
3415
3418
shell: true,
3416
3419
})
3417
3420
3421
+
// Handle Ctrl+C gracefully
3422
+
constsigintHandler=()=>{
3423
+
child.kill('SIGINT')
3424
+
resolve(130)
3425
+
}
3426
+
process.on('SIGINT',sigintHandler)
3427
+
3418
3428
child.on('exit',code=>{
3429
+
process.off('SIGINT',sigintHandler)
3419
3430
resolve(code||0)
3420
3431
})
3421
3432
3422
3433
child.on('error',()=>{
3434
+
process.off('SIGINT',sigintHandler)
3423
3435
resolve(1)
3424
3436
})
3425
3437
})
@@ -3583,32 +3595,20 @@ Fix all CI failures now by making the necessary changes.`
3583
3595
3584
3596
// Analyze and fix with Claude
3585
3597
log.progress(`Analyzing failure in ${job.name}`)
3586
-
constfixPrompt=`You are automatically fixing CI failures. The job "${job.name}" failed in workflow run ${lastRunId} for commit ${currentSha} in ${owner}/${repo}.
3587
3598
3588
-
Job: ${job.name}
3589
-
Status: ${job.conclusion}
3590
-
3591
-
Failure logs:
3592
-
${filteredLogs}
3599
+
// Keep logs under 2000 chars to avoid context issues
0 commit comments