refactor(pull-requests): type granular MCP tools - #3397
Draft
SamMorrowDrums wants to merge 2 commits into
Draft
SamMorrowDrums wants to merge 2 commits into
SamMorrowDrums wants to merge 2 commits into
Conversation
SamMorrowDrums
added this pull request to stack #3385
October 2, 2026 14:58
7 of 13 tasks
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-granular-pr-tools
branch
from
October 2, 2026 20:50
4db5f54 to
1910dae
Compare
Preserve exact legacy validation and response text while advertising concrete protocol-gated outputs for all granular PR mutations and both thread-resolution variants. Make the inherited overflow assertion architecture-independent. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-granular-pr-tools
branch
from
October 2, 2026 20:59
1910dae to
ff638f1
Compare
Auto-generated by license-check workflow
Contributor
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The broad protocol-sensitive migration across thirteen mutation tools warrants final human validation despite comprehensive automated coverage.
Review effort: Balanced
Findings: None
What changed in this PR
Migrates granular pull-request tools to concrete typed inputs and outputs, extending the typed-output work from #3396 while preserving legacy protocol behavior.
Changes:
- Adds typed DTOs, compatibility normalizers, structured outputs, and protocol-specific schemas.
- Adds comprehensive wire, validation, feature-variant, and error-path tests.
- Updates snapshots, generated documentation, and license metadata.
| File | Description |
|---|---|
third-party-licenses.windows.md |
Corrects jd license metadata. |
third-party-licenses.linux.md |
Corrects jd license metadata. |
third-party-licenses.darwin.md |
Corrects jd license metadata. |
pkg/inventory/server_tool.go |
Preserves marked input errors verbatim. |
pkg/inventory/input_error.go |
Defines the input-error marker. |
pkg/inventory/input_error_test.go |
Tests input-error formatting. |
pkg/github/typed_granular_pull_request_outputs_test.go |
Tests typed granular PR behavior. |
pkg/github/typed_granular_issue_outputs_test.go |
Makes overflow assertion architecture-independent. |
pkg/github/pullrequests_granular.go |
Converts granular PR tools to typed handlers. |
pkg/github/granular_pull_request_types.go |
Adds DTOs and compatibility normalization. |
pkg/github/__toolsnaps__/update_pull_request_title.snap |
Updates legacy title schema. |
pkg/github/__toolsnaps__/update_pull_request_title_typed.snap |
Adds typed title schema. |
pkg/github/__toolsnaps__/update_pull_request_state.snap |
Updates legacy state schema. |
pkg/github/__toolsnaps__/update_pull_request_state_typed.snap |
Adds typed state schema. |
pkg/github/__toolsnaps__/update_pull_request_draft_state.snap |
Updates legacy draft schema. |
pkg/github/__toolsnaps__/update_pull_request_draft_state_typed.snap |
Adds typed draft schema. |
pkg/github/__toolsnaps__/update_pull_request_body.snap |
Updates legacy body schema. |
pkg/github/__toolsnaps__/update_pull_request_body_typed.snap |
Adds typed body schema. |
pkg/github/__toolsnaps__/unresolve_review_thread_typed.snap |
Adds typed unresolve schema. |
pkg/github/__toolsnaps__/submit_pending_pull_request_review.snap |
Updates legacy submit schema. |
pkg/github/__toolsnaps__/submit_pending_pull_request_review_typed.snap |
Adds typed submit schema. |
pkg/github/__toolsnaps__/resolve_review_thread_typed.snap |
Adds typed resolve schema. |
pkg/github/__toolsnaps__/resolve_review_thread_resolution_reason_typed.snap |
Adds typed resolution-reason schema. |
pkg/github/__toolsnaps__/request_pull_request_reviewers.snap |
Updates legacy reviewer schema. |
pkg/github/__toolsnaps__/request_pull_request_reviewers_typed.snap |
Adds typed reviewer schema. |
pkg/github/__toolsnaps__/remove_pull_request_review_comment_reaction.snap |
Updates legacy reaction-removal schema. |
pkg/github/__toolsnaps__/remove_pull_request_review_comment_reaction_typed.snap |
Adds typed reaction-removal schema. |
pkg/github/__toolsnaps__/delete_pending_pull_request_review.snap |
Updates legacy delete schema. |
pkg/github/__toolsnaps__/delete_pending_pull_request_review_typed.snap |
Adds typed delete schema. |
pkg/github/__toolsnaps__/create_pull_request_review.snap |
Updates legacy review schema. |
pkg/github/__toolsnaps__/create_pull_request_review_typed.snap |
Adds typed review schema. |
pkg/github/__toolsnaps__/add_pull_request_review_comment.snap |
Updates legacy comment schema. |
pkg/github/__toolsnaps__/add_pull_request_review_comment_typed.snap |
Adds typed comment schema. |
pkg/github/__toolsnaps__/add_pull_request_review_comment_reaction.snap |
Updates legacy reaction schema. |
pkg/github/__toolsnaps__/add_pull_request_review_comment_reaction_typed.snap |
Adds typed reaction schema. |
docs/feature-flags.md |
Documents supported parameter values. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
Summary
Migrate all 13 granular pull request tools, including both resolve_review_thread feature variants, to concrete typed inputs and outputs. Modern 2026-07-28 clients receive output schemas and structuredContent; legacy and unknown protocols retain the exact original text without either.
Why
Stacked directly above #3396 to complete the granular PR surface without changing consolidated helpers or starting another layer. Parent verified before edits and after push:
sammorrowdrums-typed-pull-request-toolsat938c5c31b523a48ada472ca1b5a98fc15d487d3d.Fixes # — N/A; focused typed-output migration.
What changed
MCP impact
Concrete output schemas and structured content are exposed only on protocol 2026-07-28 and newer. Review mutations expose their actual success message; reference-returning mutations expose the same id/url payload as legacy text. Error results do not expose success-shaped structured content. Existing typed comment/review visibility tools are untouched.
Prompts tested (tool changes only)
go test ./pkg/github -run '^TestGranularPRDifferentialParentProbe$' -count=1passed; generated fixtures were removed afterward. Permanent parent-behavior expectations remain.Security / limits
Repo scope requirements, feature/GHES variants, destructive annotations and existing IFC/lockdown plumbing remain unchanged. No additional API fields are exposed; visibility tools and exported review helpers are unchanged. Full tests include inventory, IFC, scope and lockdown coverage.
Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint./script/testPassed:
UPDATE_TOOLSNAPS=true go test ./..., then in required orderscript/lint(0 issues),script/test(full race suite),script/generate-docs,git diff --check. Also passedgo test ./pkg/github -run '^TestTypedGranularIssueWireErrors$' -count=1and the exact-parent differential probe above. Initial lint findings were corrected before rerunning the full required sequence. No outstanding local failures. macOS was not available locally; CI must confirm the inherited assertion cleanup there. Live PAT-dependent e2e tests were not run.Head:
4db5f54f982aa7c99c73321e99892f07f5f6445b; base head:938c5c31b523a48ada472ca1b5a98fc15d487d3d. Commit includes the requested coauthor trailer; signing succeeded without fallback.Docs
Regenerated all documentation; only relevant granular PR parameter descriptions changed in docs/feature-flags.md. No unrelated generated drift included.