Skip to content

fix(agent): make direct-close paths respect pause / freeze / dry-run - #1247

Merged
JSONbored merged 1 commit into
mainfrom
fix/direct-close-paths-respect-mode
Jun 24, 2026
Merged

fix(agent): make direct-close paths respect pause / freeze / dry-run#1247
JSONbored merged 1 commit into
mainfrom
fix/direct-close-paths-respect-mode

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

The go/no-go readiness review for re-enabling autonomous review surfaced 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 gapfrozen=1 is now a complete stop (the one honest dent the readiness report called out).
  • Makes agent_dry_run a 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

  • Backend only (src/queue/processors.ts); no schema change; no migration

Validation

  • npm run test:ci — full gate green
  • npm audit --audit-level=moderate — 0 vulnerabilities
  • New tests: reopen-reclose + draft-dodge each skip under freeze (audited denied/no GitHub call) and audit a would-be close under dry-run; live behavior unchanged (existing tests pass)
  • Every changed line + branch covered

Safety

  • No secrets / wallets / hotkeys / trust scores / reward values; both changes only remove GitHub side effects under pause/freeze/dry-run
  • No site/ / CNAME / lovable

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.
@dosubot dosubot Bot added the size:M label Jun 24, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jun 24, 2026
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.97%. Comparing base (da8a339) to head (7b203db).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

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           
Files with missing lines Coverage Δ
src/queue/processors.ts 86.72% <100.00%> (+0.12%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JSONbored
JSONbored merged commit 03f1f1a into main Jun 24, 2026
18 checks passed
@JSONbored
JSONbored deleted the fix/direct-close-paths-respect-mode branch June 24, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant