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
summary: `${finalComments.length} inline comments across ${files.length} files.${hasFailures ? ` ${failedFileCount} file${failedFileCount===1 ? '' : 's'} could not be reviewed after repeated provider outages.` : ''}`,
@@ -1345,6 +1318,10 @@ async function runFinalizePhase(
1345
1318
constpartialErrorMessage=hasFailures
1346
1319
? `Partial review: ${failedFileCount} of ${files.length} file${files.length===1 ? '' : 's'} could not be reviewed after repeated model/provider outages.`
1347
1320
: null;
1321
+
// Record the posted review and mark the job done IMMEDIATELY after createReview -- before the
1322
+
// best-effort cosmetics below. The review is already on GitHub at this point; if the remaining
1323
+
// label/check-run calls exhaust this invocation's subrequest budget (large PR), we must not leave
1324
+
// the job stranded as 'failed' with review_id null. This is the critical, must-not-lose write.
1348
1325
awaitcompleteJob(env,job.id,{
1349
1326
verdict: verdictSummary.verdict,
1350
1327
fileCount: files.length,
@@ -1358,6 +1335,47 @@ async function runFinalizePhase(
summary: `${finalComments.length} inline comments across ${files.length} files.${hasFailures ? ` ${failedFileCount} file${failedFileCount===1 ? '' : 's'} could not be reviewed after repeated provider outages.` : ''}`,
1350
+
});
1351
+
// Only now is the check run genuinely completed -- record it so the maintenance sweep doesn't
1352
+
// redo it. If the update above threw, this line is skipped and completeTerminalCheckRuns will
1353
+
// finish the check run on a later invocation with a fresh budget.
logger.warn(`Post-review labels/check-run update failed for job ${job.id}; review is posted and job is completed, so leaving it best-effort`,errorinstanceofError ? error : newError(String(error)));
0 commit comments