@jojonax/codex-copilot 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/run.js +18 -21
package/package.json
CHANGED
package/src/commands/run.js
CHANGED
|
@@ -299,28 +299,25 @@ async function reviewLoop(projectDir, task, prInfo, { maxRounds: _maxRounds, pol
|
|
|
299
299
|
review_round: round,
|
|
300
300
|
});
|
|
301
301
|
|
|
302
|
-
log.info(
|
|
303
|
-
|
|
304
|
-
//
|
|
305
|
-
//
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
);
|
|
317
|
-
|
|
318
|
-
log.info('Found existing review — processing immediately');
|
|
319
|
-
gotReview = true;
|
|
320
|
-
} else {
|
|
321
|
-
gotReview = await waitForReview(projectDir, prInfo.number, pollInterval, waitTimeout);
|
|
322
|
-
}
|
|
302
|
+
log.info('Checking for review feedback...');
|
|
303
|
+
|
|
304
|
+
// Always proactively check for existing reviews first.
|
|
305
|
+
// This handles: resume after restart, review arrived before polling starts,
|
|
306
|
+
// or any case where the review is already available.
|
|
307
|
+
let gotReview = false;
|
|
308
|
+
const existingReviews = github.getReviews(projectDir, prInfo.number);
|
|
309
|
+
const existingComments = github.getIssueComments(projectDir, prInfo.number);
|
|
310
|
+
const hasReview = existingReviews.some(r => r.state !== 'PENDING');
|
|
311
|
+
const hasBotComment = existingComments.some(c =>
|
|
312
|
+
c.user?.type === 'Bot' || c.user?.login?.includes('bot')
|
|
313
|
+
);
|
|
314
|
+
|
|
315
|
+
if (hasReview || hasBotComment) {
|
|
316
|
+
log.info('Review found — processing immediately');
|
|
317
|
+
gotReview = true;
|
|
323
318
|
} else {
|
|
319
|
+
// No reviews yet — enter polling mode
|
|
320
|
+
log.info(`No review yet, polling... (timeout: ${waitTimeout}s)`);
|
|
324
321
|
gotReview = await waitForReview(projectDir, prInfo.number, pollInterval, waitTimeout);
|
|
325
322
|
}
|
|
326
323
|
|