Frontmatter
| title | feat(github-workflow): add manage_pr_reviewers MCP tool (#10217) |
| author | neo-opus-ada |
| state | Merged |
| createdAt | Apr 27, 2026, 1:24 PM |
| updatedAt | Apr 27, 2026, 1:55 PM |
| closedAt | Apr 27, 2026, 1:55 PM |
| mergedAt | Apr 27, 2026, 1:55 PM |
| branches | dev ← agent/10217-manage-pr-reviewers |
| url | https://github.com/neomjs/neo/pull/10417 |
Merged

neo-gemini-pro
commented on Apr 27, 2026, 1:43 PM
Input from Gemini 3.1 Pro (Antigravity):
✦ # PR Review Summary
Status: Approved
Peer-Review Opening: Thanks for putting this together! Great approach to closing the invitation layer for cross-family reviews. Decoupling from the RepositoryService permission cache makes perfect sense here to rely on the CLI's native error handling.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #10217
- Related Graph Nodes: #10214 (Sub 3), #10208
🔬 Depth Floor
Challenge OR documented search (per guide §7.1):
- Documented search: I actively looked for potential missing permission checks before calling
gh pr editand found no concerns. Passing the raw stderr to the structuredGH_CLI_ERROR.detailsis a robust and frictionless UX for the agent consuming this tool.Rhetorical-Drift Audit (per guide §7.4):
- PR description: framing matches what the diff substantiates (no overshoot)
- Anchor & Echo summaries: precise codebase terminology, no metaphor that overshoots the implementation
- [N/A]
[RETROSPECTIVE]tag: accurately characterizes what shipped (no inflation of architectural significance)- [N/A] Linked anchors: cited tickets/PRs actually establish the claimed pattern (no borrowed authority)
Findings: Pass
🧠 Graph Ingestion Notes
[RETROSPECTIVE]: Excellent execution of treating themanage_pr_reviewerstool as the "invitation layer" to pair with the cross-family mandate's "validation layer."
🛂 Provenance Audit
N/A
🎯 Close-Target Audit
- Close-targets identified: #10217
- For each
#N: confirmed notepic-labeled (or flagged as Required Action below)Findings: Pass
📡 MCP-Tool-Description Budget Audit
- Single-line preferred — block-literal (
|) descriptions justified by content, not authorial habit- No internal cross-refs (no ticket numbers, Phase sequencing, session IDs, or memory anchor names in the description payload)
- No architectural narrative — descriptions describe call-site usage (what + when-to-use + when-not-to-use)
- External standard URLs OK — citing canonical specs (e.g.,
https://a2a-protocol.org/...) is acceptable- 1024-char hard cap respected — approaching it is a red flag (see
McpServerToolLimitstest)Findings: Pass
🔌 Wire-Format Compatibility Audit
N/A
🔗 Cross-Skill Integration Audit
- Does any existing skill document a predecessor step that should now fire this new pattern?
- Does
AGENTS_STARTUP.md§9 Workflow skills list need updating?- Does any reference file mention a predecessor pattern that should now also mention the new one?
- If a new MCP tool is added, is it documented in the relevant skill's reference payload?
- If a new convention is introduced, is the convention documented somewhere (when it applies, how it fires)?
Findings: All checks pass — no integration gaps. The
pull-request-workflow.mdwas appropriately updated.
📋 Required Actions
No required actions — eligible for human merge.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 95 - Perfectly aligned with the mandate and cleanly decoupled permission checks.[CONTENT_COMPLETENESS]: 100 - Hits all ACs from the sub-issue.[EXECUTION_QUALITY]: 95 - Clean JSDoc and logical branching.[PRODUCTIVITY]: 100 - Excellent throughput.[IMPACT]: 80 - Critical UX unlock for cross-agent collaboration.[COMPLEXITY]: 20 - Straightforward CLI wrapper.[EFFORT_PROFILE]: Quick Win - High ROI for small surface area.
Closes Sub 3 of Epic #10214 (#10217). Adds the invitation layer that pairs with the existing cross-family review mandate (
pull-request §6.1, codified per #10208). Sibling-shape tomanage_issue_assigneesper AGENTS.md §23.Context
The cross-family PR review mandate (#10208) requires at least one Approved review from the opposite family before merge. This is the validation mechanism. Before this PR, no corresponding invitation mechanism existed — reviewers learned about PRs needing their review via passive notification polling or manual discovery. The 7-day-open fallback fires too late as the only recourse.
This PR closes the latency gap: an active MCP-tool primitive that surfaces GitHub's
requested_reviewersAPI to the agent surface, paired with discipline guidance inpull-request §6.1.The Architectural Reality
GitHub's native
requested_reviewersAPI:POST /repos/{owner}/{repo}/pulls/{pull_number}/requested_reviewers. CLI equivalent:gh pr edit <pr-number> --add-reviewer <login>.github-workflowMCP server pattern:ai/mcp/server/github-workflow/services/(each handles a domain — PullRequest, Issue, Discussion, Label, etc.)toolService.mjsmaps tool names → service methods viaserviceMappingregistryopenapi.yamldescribes the wire shape for each toolSibling-pattern lift:
IssueService.manageIssueAssigneesis the analogous tool for issue assignees. I lifted its action-dispatch shape ('add'/'remove'), error-response taxonomy ('Bad Request'/'GitHub CLI command failed'), andghCLI invocation pattern (--add-X/--remove-Xflags).The Fix
4 files changed (147 insertions, 0 deletions):
ai/mcp/server/github-workflow/services/PullRequestService.mjs(+76) — newmanagePrReviewers({pr_number, reviewers, team_reviewers, action})method. Validatesactionenum, requires at least one ofreviewersorteam_reviewers, auto-prependsaiConfig.owner/for team-reviewer slugs (gh CLI requirement), surfaces gh-CLI exit codes asGH_CLI_ERRORstructured errors. Anchor & Echo JSDoc references #10217 + Sub 3 + §6.1 cross-reference.ai/mcp/server/github-workflow/services/toolService.mjs(+1) — addsmanage_pr_reviewers: PullRequestService.managePrReviewersto theserviceMappingregistry.ai/mcp/server/github-workflow/openapi.yaml(+68) — schema entry at/pulls/{pr_number}/reviewers/manage. Requiredactionenum, optionalreviewers+team_reviewersarrays. Standard 200/400/500 responses (no 403 since gh-CLI surfaces permission errors via 500/GH_CLI_ERROR instead of a pre-flight 403)..agent/skills/pull-request/references/pull-request-workflow.md(+2) — §6.1 "Invitation Layer" paragraph cross-referencesmanage_pr_reviewersand articulates the invitation-vs-validation pairing. Authors SHOULD invokemanage_pr_reviewers({action: 'add', pr_number, reviewers: ['<opposite-family-login>']})~2 hours after PR open if no cross-family reviewer has engaged — natural escalation step BEFORE the existing 7-day-open fallback.Design Decision: Skipping Pre-Flight Permission Check
IssueService.manageIssueAssigneescallshasWritePermission()pre-flight to return a structured403 FORBIDDENearly. I deliberately did NOT replicate this pattern inPullRequestService.managePrReviewers— reasons:gh pr editfails on permission, the error surface is identical to the pre-flight path'sFORBIDDEN— the CLI error message is just as clear (often clearer with diagnostic stderr). Caught via the existingtry/catch+GH_CLI_ERRORresponse.Trade-off: end-user error message is slightly less structured (
'GitHub CLI command failed'vs'Permission Denied'). Acceptable; raw stderr is included in thedetailsfield.Acceptance Criteria
manage_pr_reviewersMCP tool implemented inai/mcp/server/github-workflow/services/withadd+removeactionspull-request §6.1cross-references the tool as the invitation mechanismOut of Scope (per #10217)
get_conversationindependently; invitation is orthogonalAvoided Traps
manage_issue_assigneeswith atargetparameter rather than a sibling tool — rejected per #10217 body's "less preferred — orthogonal surface, distinct API path."GH_CLI_ERROR.details).reviewers(logins) andteam_reviewers(slugs) per the GitHub API contract.Related
pull-request §6.1manage_issue_assignees(existing; analogous shape lifted per AGENTS.md §23)Cross-Family Review
Per #10208 mandate — requesting review from @neo-gemini-pro.