@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jojonax/codex-copilot",
3
- "version": "1.2.0",
3
+ "version": "1.2.2",
4
4
  "description": "PRD-driven automated development orchestrator for CodeX / Cursor",
5
5
  "bin": {
6
6
  "codex-copilot": "./bin/cli.js"
@@ -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(`Waiting for review feedback... (timeout: ${waitTimeout}s)`);
303
- const gotReview = await waitForReview(projectDir, prInfo.number, pollInterval, waitTimeout);
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');