From f90f4a122cd7989371e743c2da19eaf52ee43f2a Mon Sep 17 00:00:00 2001 From: ghost <49853598+JSONbored@users.noreply.github.com> Date: Wed, 8 Jul 2026 00:22:54 -0700 Subject: [PATCH] fix(queue): keep gate enforcement while autoreview is paused --- src/queue/processors.ts | 4 ++-- test/unit/queue.test.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/queue/processors.ts b/src/queue/processors.ts index 43ab15e1ae..caa945e615 100644 --- a/src/queue/processors.ts +++ b/src/queue/processors.ts @@ -3246,7 +3246,7 @@ async function reReviewStoredPullRequest( ]); let pr = await getPullRequest(env, repoFullName, prNumber); if (!pr || pr.state !== "open") return; - if (await hasAutoreviewPausedMarker(env, repoFullName, prNumber)) return; + const autoreviewPaused = await hasAutoreviewPausedMarker(env, repoFullName, prNumber); const liveFacts = createLiveGithubFacts(); // #sweep-resync: RESYNC the stored PR to its LIVE head before reviewing. The self-host relay can drop the // `synchronize` webhook (relay down), so a push/rebase never refreshes the stored head SHA + cached files; the @@ -3381,7 +3381,7 @@ async function reReviewStoredPullRequest( baseSha: live?.base?.sha ?? null, liveFacts, ...(previewPollAttempt !== undefined ? { previewPollAttempt } : {}), - ...(options.skipAiReview ? { skipAiReview: true } : {}), + ...(options.skipAiReview || autoreviewPaused ? { skipAiReview: true } : {}), ...(options.force ? { forceAiReview: true } : {}), hasPendingRefreshSignal: otherRefreshReasons || reviewsCacheStale, }, diff --git a/test/unit/queue.test.ts b/test/unit/queue.test.ts index e61e72e8d9..3a0181defb 100644 --- a/test/unit/queue.test.ts +++ b/test/unit/queue.test.ts @@ -4259,7 +4259,7 @@ describe("queue processors", () => { expect(skipAudit).toBeUndefined(); }); - it("does not publish the re-review surface once a PR has an autoreview pause marker (#2164 regression)", async () => { + it("skips AI review but still enforces the gate once a PR has an autoreview pause marker (#2164 regression)", async () => { let aiCalls = 0; let commentPosted = false; let checkRunWritten = false; @@ -4318,7 +4318,7 @@ describe("queue processors", () => { ).resolves.toBeUndefined(); expect(aiCalls).toBe(0); expect(commentPosted).toBe(false); - expect(checkRunWritten).toBe(false); + expect(checkRunWritten).toBe(true); }); it("threads review.ai_model through the full webhook pipeline into ai.run's options (#selfhost-ai-model-override)", async () => {