@jojonax/codex-copilot 1.2.0 → 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 +21 -2
package/package.json
CHANGED
package/src/commands/run.js
CHANGED
|
@@ -299,8 +299,27 @@ async function reviewLoop(projectDir, task, prInfo, { maxRounds: _maxRounds, pol
|
|
|
299
299
|
review_round: round,
|
|
300
300
|
});
|
|
301
301
|
|
|
302
|
-
log.info(
|
|
303
|
-
|
|
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;
|
|
318
|
+
} else {
|
|
319
|
+
// No reviews yet — enter polling mode
|
|
320
|
+
log.info(`No review yet, polling... (timeout: ${waitTimeout}s)`);
|
|
321
|
+
gotReview = await waitForReview(projectDir, prInfo.number, pollInterval, waitTimeout);
|
|
322
|
+
}
|
|
304
323
|
|
|
305
324
|
if (!gotReview) {
|
|
306
325
|
log.warn('Review wait timed out');
|