fix(agent): make direct-close paths respect pause / freeze / dry-run - #1247
Merged
Conversation
The readiness review for re-enabling autonomous review found two autonomous PR-close paths that call closePullRequest DIRECTLY, bypassing the executor chokepoint — so they honored neither the per-repo pause, the global freeze (#1243), nor agent_dry_run: - maybeRecloseDisallowedReopen (reopen-reclose) consulted none of them. - The draft-dodge auto-close honored agentPaused but not the freeze or dry-run. Both now resolve the agent action mode (the same env-brake || global-freeze || per-repo-pause || dry-run logic the executor uses) and gate the GitHub close on it: paused/frozen → no action, dry-run → audit the would-be close without touching GitHub, live → close as before. This closes the kill-switch coverage gap (frozen=1 is now a COMPLETE stop) and makes agent_dry_run a true no-op for these paths — a prerequisite for safely re-enabling review in dry-run first.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1247 +/- ##
=======================================
Coverage 94.97% 94.97%
=======================================
Files 177 177
Lines 19794 19805 +11
Branches 7118 7125 +7
=======================================
+ Hits 18799 18810 +11
Misses 397 397
Partials 598 598
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The go/no-go readiness review for re-enabling autonomous review surfaced two autonomous PR-close paths that call
closePullRequestdirectly, bypassing the executor chokepoint — so they honored neither the per-repo pause, the global freeze (#1243), noragent_dry_run:maybeRecloseDisallowedReopen(reopen-reclose) consulted none of them.agentPausedbut not the freeze or dry-run.Both now resolve the agent action mode (the same
env-brake || global-freeze || per-repo-pause || dry-runlogic the executor uses) and gate the GitHub close on it: paused/frozen → no action; dry-run → audit the would-be close without touching GitHub; live → close as before.This:
frozen=1is now a complete stop (the one honest dent the readiness report called out).agent_dry_runa true no-op for these paths — a prerequisite for safely re-enabling review in dry-run first (otherwise a reopen or a draft-conversion could trigger a real close during a "dry-run").Scope
src/queue/processors.ts); no schema change; no migrationValidation
npm run test:ci— full gate greennpm audit --audit-level=moderate— 0 vulnerabilitiesdenied/no GitHub call) and audit a would-be close under dry-run; live behavior unchanged (existing tests pass)Safety
site//CNAME/lovable