Repository navigation
refactor(pull-requests): migrate consolidated PR tools to typed inputs and outputs - #3396
Merged
Merged
Conversation
SamMorrowDrums
added this pull request to stack #3385
October 2, 2026 14:33
7 of 13 tasks
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-pull-request-tools
branch
from
October 2, 2026 20:50
938c5c3 to
fe126a7
Compare
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-pull-request-tools
branch
from
October 2, 2026 20:59
fe126a7 to
41e1877
Compare
SamMorrowDrums
marked this pull request as ready for review
October 5, 2026 10:26
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Compatibility normalizers introduce several observable regressions in legacy validation behavior and error ordering.
Review effort: Balanced
Findings: 4
Open (4)
What changed in this PR
Migrates consolidated pull-request tools to typed inputs and structured outputs while retaining legacy text responses.
Changes:
- Adds typed DTOs, schemas, and compatibility normalizers.
- Adds protocol, schema, coercion, and API-error tests.
- Updates tool snapshots and generated license references.
| File | Description |
|---|---|
pkg/github/pullrequests.go |
Registers typed pull-request tools and outputs. |
pkg/github/consolidated_pull_request_types.go |
Defines DTOs, schemas, and normalizers. |
pkg/github/typed_consolidated_pull_request_outputs_test.go |
Tests protocols, outputs, schemas, and errors. |
pkg/github/__toolsnaps__/pull_request_read.snap |
Updates read-tool snapshot. |
pkg/github/__toolsnaps__/pull_request_read_typed.snap |
Adds typed read-tool snapshot. |
pkg/github/__toolsnaps__/create_pull_request.snap |
Updates create-tool snapshot. |
pkg/github/__toolsnaps__/create_pull_request_typed.snap |
Adds typed create-tool snapshot. |
pkg/github/__toolsnaps__/update_pull_request.snap |
Updates update-tool snapshot. |
pkg/github/__toolsnaps__/update_pull_request_typed.snap |
Adds typed update-tool snapshot. |
pkg/github/__toolsnaps__/merge_pull_request.snap |
Updates merge-tool snapshot. |
pkg/github/__toolsnaps__/merge_pull_request_typed.snap |
Adds typed merge-tool snapshot. |
pkg/github/__toolsnaps__/update_pull_request_branch.snap |
Updates branch-tool snapshot. |
pkg/github/__toolsnaps__/update_pull_request_branch_typed.snap |
Adds typed branch-tool snapshot. |
pkg/github/__toolsnaps__/pull_request_review_write.snap |
Updates review-write snapshot. |
pkg/github/__toolsnaps__/pull_request_review_write_typed.snap |
Adds typed review-write snapshot. |
pkg/github/__toolsnaps__/pull_request_review_write_resolution_reason_typed.snap |
Adds feature-variant snapshot. |
pkg/github/__toolsnaps__/add_comment_to_pending_review.snap |
Updates pending-comment snapshot. |
pkg/github/__toolsnaps__/add_comment_to_pending_review_typed.snap |
Adds typed pending-comment snapshot. |
pkg/github/__toolsnaps__/add_reply_to_pull_request_comment.snap |
Updates reply-tool snapshot. |
pkg/github/__toolsnaps__/add_reply_to_pull_request_comment_typed.snap |
Adds typed reply-tool snapshot. |
third-party-licenses.darwin.md |
Corrects dependency license reference. |
third-party-licenses.linux.md |
Corrects dependency license reference. |
third-party-licenses.windows.md |
Corrects dependency license reference. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-pull-request-tools
branch
from
October 5, 2026 15:35
4064e57 to
10c3679
Compare
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-pull-request-tools
branch
from
October 6, 2026 16:12
3e0f06a to
1311814
Compare
kerobbi
previously approved these changes
Oct 6, 2026
Migrate the remaining 17 repository tools to concrete inputs and outputs. Preserve existing content, mutations, scopes, filtering, and protocol gating; add wire and schema conformance coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace raw REST output schemas with compact repository DTOs, retain one canonical snapshot per tool, and align modern JSON text with structured output while pinning legacy content. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve raw helper APIs and exact legacy text while exposing concrete output unions for modern protocols. Retain explicit awaiting statuses and real null responses without exposing SDK-generated error fallbacks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Auto-generated by license-check workflow
Project compact method-discriminated DTOs from API responses while preserving the separate legacy text formatter and explicit app-awaiting status. Cache strict schemas and keep only canonical snapshots. Strengthen null-member presence, schema size, and lockdown projection regressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve forbidden variant properties as annotated schema objects rather than boolean schemas emitted by jsonschema-go. Cover Inspector's input paths and IFC labels on every issue-read method across protocols. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Reject unknown methods, states, field types, opaque values and API URL properties while covering nullable and empty method data. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Pin unchanged legacy profile/avatar fields separately from compact modern user projections and assert identical lockdown filtering and sanitization across protocols. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove added custom-field union constraints and sentinel enums from the advertised issue-write input. Preserve runtime exactly-one validation and private strict-schema tests. All three scoped input schemas compare exactly equal to main. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Auto-generated by license-check workflow
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> # Conflicts: # pkg/github/__toolsnaps__/add_sub_issue.snap # pkg/github/__toolsnaps__/remove_sub_issue.snap # pkg/github/__toolsnaps__/reprioritize_sub_issue.snap # pkg/github/granular_issue_types.go # pkg/github/issues_granular.go # pkg/github/typed_granular_issue_outputs_test.go # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # interactive rebase in progress; onto 1973eee # Last command done (1 command done): # pick 5b8f9d19 # refactor(issues): minimize granular structured outputs # No commands remaining. # You are currently rebasing. # # Changes to be committed: # modified: pkg/github/__toolsnaps__/add_issue_comment_reaction.snap # modified: pkg/github/__toolsnaps__/add_issue_reaction.snap # modified: pkg/github/__toolsnaps__/add_sub_issue.snap # modified: pkg/github/__toolsnaps__/create_issue.snap # modified: pkg/github/__toolsnaps__/hide_issue_comment.snap # modified: pkg/github/__toolsnaps__/remove_issue_comment_reaction.snap # modified: pkg/github/__toolsnaps__/remove_issue_reaction.snap # modified: pkg/github/__toolsnaps__/remove_sub_issue.snap # modified: pkg/github/__toolsnaps__/reprioritize_sub_issue.snap # modified: pkg/github/__toolsnaps__/set_issue_fields.snap # modified: pkg/github/__toolsnaps__/unhide_issue_comment.snap # modified: pkg/github/__toolsnaps__/update_issue_assignees.snap # modified: pkg/github/__toolsnaps__/update_issue_body.snap # modified: pkg/github/__toolsnaps__/update_issue_labels.snap # modified: pkg/github/__toolsnaps__/update_issue_milestone.snap # modified: pkg/github/__toolsnaps__/update_issue_state.snap # modified: pkg/github/__toolsnaps__/update_issue_title.snap # modified: pkg/github/__toolsnaps__/update_issue_type.snap # modified: pkg/github/comment_minimize_test.go # new file: pkg/github/granular_issue_types.go # modified: pkg/github/granular_tools_test.go # modified: pkg/github/issues_granular.go # new file: pkg/github/typed_granular_issue_outputs_test.go #
Preserve legacy text and search semantics while publishing protocol-gated concrete structured outputs. Cover modern, legacy, and unknown clients, full repository JSON unions, defaults, IFC labels, and errors. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replace the full REST repository mirror with MinimalRepository-based structured items plus purpose-built full-mode details. Legacy text remains unchanged, and canonical snapshots now hold the modern output schema. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove the derivable node_id from compact full repository search output and publish the visibility enum in the static output schema. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep the modern text assertion aligned with structured content after the shared output wrapper change. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…s and outputs Convert pull_request_read, create_pull_request, update_pull_request, merge_pull_request, update_pull_request_branch, pull_request_review_write (both feature variants), add_comment_to_pending_review and add_reply_to_pull_request_comment to NewTool with concrete inputs and output DTOs. Input normalizers replay legacy handler checks so legacy coercions and error text are preserved. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use curated output DTOs for modern JSON text while preserving legacy serialization. Cover successful null responses, empty check runs, and Link-header page traversal. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Replay parameter checks in handler order and scope cursor validation to review-thread reads. Keep commit message schema descriptions distinct from operation messages. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove normalization and test assertions that only pinned which invalid argument wins. Keep per-field validation, accepted coercions, and response-shape behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
SamMorrowDrums
dismissed
kerobbi’s stale review
October 6, 2026 22:11
The merge-base changed after approval.
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-pull-request-tools
branch
from
October 6, 2026 22:11
1311814 to
c77a3e2
Compare
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
Moves the consolidated pull request tools in
pkg/github/pullrequests.gotoNewTool[In,Out]with concrete inputs and output DTOs. Stacked on #3395.Why
Continues the typed-output stack. Modern-protocol clients get schema-valid
structuredContent, while legacy and unknown protocols get the same output as before.Fixes #
What changed
pull_request_read,create_pull_request,update_pull_request,merge_pull_request,update_pull_request_branch,pull_request_review_write(both the default and the thread-resolution-reason variants),add_comment_to_pending_reviewandadd_reply_to_pull_request_comment.consolidated_pull_request_types.gowith:oneOfunion for thepull_request_readmethods, with a diff variant and a null variant.review_writekeys matched case-insensitively, plus its WeakDecode behaviour;commentIdBigInt and< 1errors;title/head/baseare missing.structuredContentis sent only on 2026-07-28 and omitted on legacy and unknown protocols.typed_consolidated_pull_request_outputs_test.gocover:c918f4b;_typedsnapshots.MCP impact
Prompts tested (tool changes only)
Security / limits
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— passed (0 issues)./script/test— passedAlso run:
UPDATE_TOOLSNAPS=true go test ./...— passedscript/generate-docs— no doc changesgit diff --check— cleanKnown CI: an inherited macOS flake from #3395 in
typed_granular_issue_outputs_test.go:389(the int64 overflow message differs on macOS).Docs
script/generate-docsproduced no changes.