fix(review): exclude current head from auto-pause count - #3719
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Warning 🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨 ⏸️ Gittensory review result - manual review recommendedReview updated: 2026-07-06 06:30:24 UTC
⏸️ Suggested Action - Manual Review
Review summary Nits — 4 non-blocking
Concerns raised — review before merging
Review context
Contributor next steps
Signal definitions
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3719 +/- ##
=======================================
Coverage 93.36% 93.36%
=======================================
Files 315 315
Lines 32204 32206 +2
Branches 11812 11814 +2
=======================================
+ Hits 30066 30068 +2
Misses 1507 1507
Partials 631 631
🚀 New features to boost your workflow:
|
…it never paused (#4319) countPublishedAiReviewHeads excluded the current head SHA from its count (#3719), meaning a PR swept repeatedly with no new commits could never reach auto_pause_after_reviewed_commits' threshold -- the one head it had ever been reviewed on was always the "current" one, always subtracted back out. Confirmed live: one PR took 63 fresh AI calls across 12 hours of scheduled sweeps with zero new commits. #3719 excluded the current head specifically to avoid a real problem: once paused, the cached review's findings were never reapplied, so an already-published blocker would silently vanish from later gate evaluations. Fixes that properly instead of avoiding it: the count now includes the current head (matching its own "published review count" contract), and a new reuse branch in processors.ts reapplies the last published review's findings whenever the pause reason fires, mirroring the existing frozen-for-manual-review reuse pattern.
Motivation
Description
countPublishedAiReviewHeadsto accept an optionalcurrentHeadShaand exclude it from the SQLCOUNT(DISTINCT head_sha)so the threshold only counts prior published heads.headSha) intoresolveAutoReviewSkipForPullRequestso the helper can exclude the active head when deciding a pause.Testing
npx vitest run test/unit/ai-review-cache.test.ts test/unit/auto-review-wiring.test.ts, and all tests in those files passed.npm run typecheck, which passed.npm run test:coverage) and a coverage-enabled run of the two targeted tests; the targeted tests ran cleanly but a full global coverage run was not completed in this environment (global coverage threshold check did not finish here).npm audit --audit-level=moderatecould not complete due to the registry returning403 Forbiddenin this environment.Codex Task