Skip to content

Agent-authored infra PRs are hard to merge — approval-identity + bot-review friction #617

Closed

Description

@don-petry

Parent: #495 · Work type: Infra · Surfaced repeatedly while landing #440 / #448 / #571.

Problem

Merging agent/maintainer-authored infrastructure PRs is consistently high-friction. Recurring blockers, none code-quality related:

  1. Self-author can't approve. PRs are opened as don-petry (the gh-authed identity). The org-leads CODEOWNER approval must come from a different identity — donpetry-bot (the pr-review agent). GitHub blocks self-approval.
  2. require_last_push_approval vs the bot pusher. When donpetry-bot pushes the last commit (e.g. the dev-lead agent auto-addressing review feedback), its own approval no longer satisfies require_last_push_approval — needing a trivial don-petry push to reset the last-pusher.
  3. CodeRabbit CHANGES_REQUESTED stickiness. A later COMMENTED review does not clear a prior CHANGES_REQUESTED; it persists on a stale commit and blocks reviewDecision even with 0 unresolved threads, until CodeRabbit re-APPROVEs or the review is dismissed.
  4. Flaky .github review automation. On the public .github repo, pr-review-mention skips/fails (e.g. 'Post acknowledgement comment' exit 1) and pr-auto-review doesn't reliably dispatch the agent — so the org-leads approval never lands on its own.
  5. CI-gate interaction (tracked in pr-review CI gate should gate on REQUIRED checks only — non-required CANCELLED *and* FAILED checks falsely block reviews #608): non-required failed/cancelled checks make the agent skip approving.

Evidence

Possible directions (for discussion)

  • A dedicated reviewer identity / GitHub App that supplies the org-leads CODEOWNER approval reliably (decoupled from the author + last-pusher).
  • Auto-dismiss stale bot CHANGES_REQUESTED reviews on push (a small action), or treat bot reviews as advisory (not gating).
  • Relax require_last_push_approval for bot-authored fix commits on agent-infra PRs, or have the agent always make the human the last pusher.
  • Fix the .github pr-review-mention/pr-auto-review dispatch reliability.

This is the systemic root behind much of the manual PR-unsticking. Pairs with #608 (CI gate) — together they'd remove most agent-PR merge friction.

Activity

  1. don-petry commented on Jul 14, 2026

    @don-petry
    CollaboratorAuthor

    Mitigation status (2026-07-14)

    Blocker #5 (CI-gate interaction) is now fully addressed: #608 made superseded CANCELLED dev-lead checks non-blocking, and PR #1230 (#619) lets a manual FORCE_REVIEW bypass the ci-failing gate — so an agent PR carrying a failing non-required check can now be approved via @mention (the ruleset still blocks genuinely-failing required checks). The auto-rebase auto-rebase:ready labeling (#1201/#1202) + Part C (#713) and the stuck-review sweep (#573/#898) also reduce the friction in blockers #1/#4.

    Remaining are process/posture decisions (your call — I've deliberately not changed these unilaterally):

    1. Reviewer identity — a dedicated GitHub App / bot that reliably supplies the org-leads CODEOWNER approval, decoupled from author + last-pusher. (Addresses test issue from agent #1 + Go-live improvements for PR review agent #2.)
    2. Stale bot CHANGES_REQUESTED — auto-dismiss on push (small action) or treat bot reviews as advisory (non-gating). (Addresses Add @claude delegation, auto-merge, and rebase handling #3 — CodeRabbit stickiness.)
    3. require_last_push_approval — relax for bot-authored fix commits, or always make the human the last pusher. (Addresses Go-live improvements for PR review agent #2 — branch-protection change.)
    4. .github dispatch reliability — fix pr-review-mention/pr-auto-review flakiness on the public repo. (Addresses Optimize review: small-PR and incremental fast paths #4 — a separate reliability fix.)

    Each is a security/process-posture choice; happy to implement whichever direction you pick.

  2. don-petry commented on Oct 21, 2026

    @don-petry
    CollaboratorAuthor

    Closing after the 2026-10-21 backlog triage.

    Why: Grab-bag of June friction; mitigations shipped; remaining bot friction is #2276 B.
    Evidence: PRs #1230, #1233; #1316 fix; #2276 B

    Reopen if this still reproduces on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug reports

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions