You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When looper runs as a bot account (e.g. ankaboot-bot) and the worker opens PRs as that bot, the reviewer cannot APPROVE its own PRs (GitHub blocks self-approval). Looper correctly downgrades APPROVE → COMMENT via selfApprovalFallback, but the auto-merge path requires marker.Event == ReviewEventApprove and returns early on COMMENT — so EnableAutoMerge is never called.
GitHub autoMergeRequest: null on the PR — auto-merge was never enabled.
Root cause
internal/reviewer/runner.go:
Line 3791-3801 (submitOrReuseReview): selfApprovalFallback := event == ReviewEventApprove && sameReviewAuthorLogin(detail.Author, currentLogin) — when PR author == current user (bot), downgrades APPROVE → COMMENT. This is correct (GitHub forbids self-approval).
Line 3672 (publishCriteriaApprovedReview): if marker.Event != ReviewEventApprove { return ... } — since marker.Event is COMMENT (downgraded), returns early and never calls decideAutoMerge or EnableAutoMerge.
The selfApprovalFallback correctly handles the review event, but the auto-merge path does not account for it.
#352 (auto-merge PRD) assumes Reviewer's APPROVE as the trigger. It does not address the case where the reviewer and PR author share the same GitHub identity (single-bot-account mode), where APPROVE is downgraded to COMMENT by selfApprovalFallback.
Same root cause as #598 (single-identity mode): the bot can review (COMMENT) but cannot approve or auto-merge its own PRs.
Expected behavior
When autoMerge.enabled = true and the reviewer marks the PR outcome=clean, auto-merge should be enabled via GitHub's native auto-merge API (gh pr merge --auto), even if the review event was downgraded to COMMENT by selfApprovalFallback. GitHub's branch protection (not the review event type) is the authority for "safe to merge" per #352.
Proposed fix
In publishCriteriaApprovedReview (runner.go:3672), relax the gate:
Or, more robustly: gate on outcome=clean (the reviewer's verdict) rather than marker.Event (the GitHub review event type), since selfApprovalFallback already correctly downgrades the event type for GitHub API compliance.
Summary
When looper runs as a bot account (e.g.
ankaboot-bot) and the worker opens PRs as that bot, the reviewer cannotAPPROVEits own PRs (GitHub blocks self-approval). Looper correctly downgradesAPPROVE→COMMENTviaselfApprovalFallback, but the auto-merge path requiresmarker.Event == ReviewEventApproveand returns early onCOMMENT— soEnableAutoMergeis never called.Evidence
PR:
ankaboot-source/m3llm#180(bot-authored, reviewer-clean)outcome=clean(all fixer corrections verified).[roles.reviewer.autoMerge] enabled = true, requireBranchProtection = false, scope = "looper-only", strategy = "squash".reviewEvents.clean = "APPROVE".autoMergeRequest: nullon the PR — auto-merge was never enabled.Root cause
internal/reviewer/runner.go:Line 3791-3801 (
submitOrReuseReview):selfApprovalFallback := event == ReviewEventApprove && sameReviewAuthorLogin(detail.Author, currentLogin)— when PR author == current user (bot), downgradesAPPROVE→COMMENT. This is correct (GitHub forbids self-approval).Line 3672 (
publishCriteriaApprovedReview):if marker.Event != ReviewEventApprove { return ... }— sincemarker.EventisCOMMENT(downgraded), returns early and never callsdecideAutoMergeorEnableAutoMerge.The
selfApprovalFallbackcorrectly handles the review event, but the auto-merge path does not account for it.Relationship to #352
#352 (auto-merge PRD) assumes
Reviewer's APPROVEas the trigger. It does not address the case where the reviewer and PR author share the same GitHub identity (single-bot-account mode), whereAPPROVEis downgraded toCOMMENTbyselfApprovalFallback.Relationship to #598
Same root cause as #598 (single-identity mode): the bot can review (COMMENT) but cannot approve or auto-merge its own PRs.
Expected behavior
When
autoMerge.enabled = trueand the reviewer marks the PRoutcome=clean, auto-merge should be enabled via GitHub's native auto-merge API (gh pr merge --auto), even if the review event was downgraded toCOMMENTbyselfApprovalFallback. GitHub's branch protection (not the review event type) is the authority for "safe to merge" per #352.Proposed fix
In
publishCriteriaApprovedReview(runner.go:3672), relax the gate:Or, more robustly: gate on
outcome=clean(the reviewer's verdict) rather thanmarker.Event(the GitHub review event type), sinceselfApprovalFallbackalready correctly downgrades the event type for GitHub API compliance.Environment
ankaboot-bot)roles.reviewer.autoMerge.enabled = true,requireBranchProtection = falseReproduction
outcome=cleanpublishCriteriaApprovedReviewreturns early (marker.Event != APPROVE)EnableAutoMergenever called → PR sits at human gate indefinitelyContext