@jojonax/codex-copilot 1.2.0 → 1.2.1
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 +23 -1
package/package.json
CHANGED
package/src/commands/run.js
CHANGED
|
@@ -300,7 +300,29 @@ async function reviewLoop(projectDir, task, prInfo, { maxRounds: _maxRounds, pol
|
|
|
300
300
|
});
|
|
301
301
|
|
|
302
302
|
log.info(`Waiting for review feedback... (timeout: ${waitTimeout}s)`);
|
|
303
|
-
|
|
303
|
+
|
|
304
|
+
// When resuming from waiting_review, the review may have already arrived
|
|
305
|
+
// before the restart. Check for existing reviews first before polling.
|
|
306
|
+
const isResuming = (state.current_task === task.id && state.phase === 'review'
|
|
307
|
+
&& state.phase_step === 'waiting_review' && round === startRound);
|
|
308
|
+
|
|
309
|
+
let gotReview;
|
|
310
|
+
if (isResuming) {
|
|
311
|
+
const existingReviews = github.getReviews(projectDir, prInfo.number);
|
|
312
|
+
const existingComments = github.getIssueComments(projectDir, prInfo.number);
|
|
313
|
+
const hasReview = existingReviews.some(r => r.state !== 'PENDING');
|
|
314
|
+
const hasBotComment = existingComments.some(c =>
|
|
315
|
+
c.user?.type === 'Bot' || c.user?.login?.includes('bot')
|
|
316
|
+
);
|
|
317
|
+
if (hasReview || hasBotComment) {
|
|
318
|
+
log.info('Found existing review — processing immediately');
|
|
319
|
+
gotReview = true;
|
|
320
|
+
} else {
|
|
321
|
+
gotReview = await waitForReview(projectDir, prInfo.number, pollInterval, waitTimeout);
|
|
322
|
+
}
|
|
323
|
+
} else {
|
|
324
|
+
gotReview = await waitForReview(projectDir, prInfo.number, pollInterval, waitTimeout);
|
|
325
|
+
}
|
|
304
326
|
|
|
305
327
|
if (!gotReview) {
|
|
306
328
|
log.warn('Review wait timed out');
|