pr-management-triage: allow maintainer @-mentions on the operator's own PRs#771
Merged
Merged
Conversation
…wn PRs The mention guard enforced author-only notification for every guarded comment, which also blocked the legitimate case of the operator nudging their own reviewers on their own PR. Exempt that case: when the target's author is the authenticated `gh` user, allow the mention. Operator resolution failing falls through to the existing author-only rule (fail-safe). The `MAGPIE_ALLOW_MENTIONS=1` override for any other deliberate exception is unchanged. Adds own-PR test coverage (allow, case-insensitive, and others'-PR still denied when the operator resolves), makes the existing fold-edit test hermetic (it previously relied on a real `gh pr view` failing), and updates the agent-guard README table and Golden rule 12. Generated-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
The
mentionguard enforced author-only notification on every guardedgh pr/issue comment(andgh pr edit --body). That also blocked a legitimate case: the operator nudging their own reviewers on their own PR.Change
When the target PR/issue author is the authenticated
ghuser (gh api user), the guard now allows the mention. If operator resolution fails it falls through to the existing author-only rule (fail-safe). TheMAGPIE_ALLOW_MENTIONS=1override for any other deliberate exception is unchanged.Tests / docs
gh pr viewfailing, which broke once the own-PR exemption could fire against a real PR).Full workspace pre-commit (ruff/mypy/pytest across all members) passes.
🤖 Generated with Claude Code