feat(comments): add typed visibility tool inputs and outputs - #3384
Open
SamMorrowDrums wants to merge 3 commits into
Open
SamMorrowDrums wants to merge 3 commits into
SamMorrowDrums wants to merge 3 commits into
Conversation
SamMorrowDrums
added this pull request to stack #3385
October 2, 2026 10:03
SamMorrowDrums
marked this pull request as ready for review
October 2, 2026 10:05
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The typed migration preserves existing contracts and is comprehensively covered across supported protocol versions and failure paths.
Review effort: Balanced
Findings: None
What changed in this PR
Migrates six comment-visibility tools to typed inputs and outputs while preserving legacy behavior and protocol-gating structured results.
Changes:
- Adds typed visibility inputs, output schemas, and normalized legacy arguments.
- Preserves feature, scope, read-only, and error behavior.
- Adds comprehensive protocol and behavior tests with updated snapshots.
| File | Description |
|---|---|
pkg/github/comment_minimize.go |
Implements typed visibility tools and normalization. |
pkg/github/comment_minimize_test.go |
Tests schemas, protocols, gates, and errors. |
pkg/github/__toolsnaps__/hide_issue_comment.snap |
Adds hide output schema. |
pkg/github/__toolsnaps__/unhide_issue_comment.snap |
Adds unhide output schema. |
pkg/github/__toolsnaps__/hide_pull_request_review_comment.snap |
Adds hide output schema. |
pkg/github/__toolsnaps__/unhide_pull_request_review_comment.snap |
Adds unhide output schema. |
pkg/github/__toolsnaps__/hide_pull_request_review.snap |
Adds hide output schema. |
pkg/github/__toolsnaps__/unhide_pull_request_review.snap |
Adds unhide output schema. |
💡 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-comment-visibility-tools
branch
from
October 2, 2026 10:18
65bbe67 to
9c35bd3
Compare
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-comment-visibility-tools
branch
from
October 2, 2026 10:24
9c35bd3 to
a4e5b24
Compare
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-comment-visibility-tools
branch
from
October 2, 2026 10:37
a4e5b24 to
d593079
Compare
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-comment-visibility-tools
branch
from
October 2, 2026 10:59
0f312ad to
43f5bcb
Compare
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-comment-visibility-tools
branch
from
October 2, 2026 11:13
17a8525 to
603c895
Compare
Preserve legacy argument normalization and text responses while exposing protocol-gated structured results for six hide/unhide tools. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Auto-generated by license-check workflow
SamMorrowDrums
force-pushed
the
sammorrowdrums-typed-comment-visibility-tools
branch
from
October 2, 2026 20:50
603c895 to
7e9c697
Compare
Auto-generated by license-check workflow
Contributor
|
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 the shared hide/unhide comment-visibility factory to typed inputs and results for all six issue-comment, pull-request review-comment, and review tools. Legacy text stays unchanged; output schemas and structured results are visible only on MCP protocol 2026-07-28 or later.
Why
Dependent layer above #3377, using the typed registration and legacy normalization foundation from #3371. No issue is closed by this layer; #3360 remains unchanged and open.
What changed
MCP impact
Output schemas and typed structured content are added for modern clients. Existing input schemas and legacy success text remain unchanged; errors remain errors without structured success output.
Prompts tested (tool changes only)
Security / limits
The existing repo scope requirement, granular feature flags, read-only filtering, permission descriptions and API calls are preserved. Structured output contains the same node ID and visibility fields as existing text; invalid inputs and failed mutations never yield successful structured output.
Tool renaming
deprecated_tool_aliases.goAll six tool names are unchanged.
Note: 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/test./script/lintwas replaced by the requested Go-compatible change-only linter because the pinned linter is incompatible with Go 1.27.1.gofmt -w pkg/github/comment_minimize.go pkg/github/comment_minimize_test.gocompleted successfully./tmp/golangci-lint/golangci-lint run --new-from-rev=484c813c3b3a7d84a38dbe8365299d1b2090e982passed with 0 issues.script/testpassed (go test -race ./...).go test ./pkg/github -run 'Test_CommentVisibilityToolSchemas|TestCommentVisibilityTypedInputSchemaMatchesLegacy|TestCommentVisibilityProtocols|TestCommentVisibilityProtocolGating|TestNormalizeCommentVisibilityInput|Test_HideAndUnhideComments' -count=1passed.UPDATE_TOOLSNAPS=true go test ./pkg/github -run 'Test_CommentVisibilityToolSchemas|TestGranularToolSnaps' -count=1passed when updating the six relevant snapshots. Live PAT-dependent e2e tests were not run.Docs
script/generate-docspassed; all generated documentation remained unchanged. Input schema and tool names/descriptions are unchanged, and the related output snapshots document the added API surface.