fix: review skipped silently when task diff exceeds 1MB maxBuffer
getCommitRangeDiff and getLatestCommitDiff had maxBuffer set to 1MB. When a task produced a larger diff (common for 10+ minute tasks), execSync threw, the catch block returned null, and the review loop broke immediately with no message — reviews were silently skipped for larger tasks while smaller tasks reviewed fine. - Increase maxBuffer to 10MB in both functions (the review prompt builder already truncates to MAX_DIFF_BYTES = 50KB before sending to the model, so the full diff in memory is fine) - Add a diagnostic sendChatMessage when the review loop is skipped (baseRef undefined or no diff), so silent skips are visible
This commit is contained in:
@@ -877,7 +877,15 @@ async function executeTask(
|
||||
const reviewInfo = baseRef
|
||||
? getCommitRangeDiff(worktreeDir, baseRef)
|
||||
: null;
|
||||
if (!reviewInfo || !reviewInfo.diff) break; // nothing to review
|
||||
if (!reviewInfo || !reviewInfo.diff) {
|
||||
const reason = !baseRef
|
||||
? "could not capture base ref before execution"
|
||||
: "no changes found between base and HEAD";
|
||||
sendChatMessage?.(
|
||||
`~ review for ${task.id} · ${task.title} — skipping review (${reason})`,
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
const reviewPrompt = buildReviewPrompt(
|
||||
task,
|
||||
|
||||
Reference in New Issue
Block a user