Skip to content

feat(comments): add typed visibility tool inputs and outputs - #3384

Open
SamMorrowDrums wants to merge 3 commits into
sammorrowdrums-typed-context-tool-schemasfrom
sammorrowdrums-typed-comment-visibility-tools
Open

SamMorrowDrums wants to merge 3 commits into
sammorrowdrums-typed-context-tool-schemasfrom
sammorrowdrums-typed-comment-visibility-tools

Conversation

@SamMorrowDrums

Copy link
Copy Markdown
Collaborator

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

  • Add typed comment visibility input and output handling while retaining target-specific schemas, exact descriptions, required identifiers, numeric minimums, permissions and feature rules.
  • Normalize legacy numeric-string IDs and classifier casing through the foundation hook before SDK validation; preserve ignored arguments and rejection semantics.
  • Add fresh-session wire tests for both negotiated protocol versions, all hide/unhide targets, output conformance, schema equivalence, API errors and feature/scope/read-only gates; update only the six related snapshots.

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed
  • New tool added
    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)

  • Mocked wire-call equivalents of “Hide issue comment 1 as off-topic”, “Unhide inline pull request review comment 2”, and “Hide/unhide review 3 on pull request 42”; these are automated protocol tests, not live GitHub prompt runs.

Security / limits

  • No security or limits impact
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered
    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

  • I am renaming tools as part of this PR (e.g. a part of a consolidation effort)
    • I have added the new tool aliases in deprecated_tool_aliases.go
  • I am not renaming tools as part of this PR
    All 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

  • Linted locally with ./script/lint
  • Tested locally with ./script/test
    ./script/lint was 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.go completed successfully. /tmp/golangci-lint/golangci-lint run --new-from-rev=484c813c3b3a7d84a38dbe8365299d1b2090e982 passed with 0 issues. script/test passed (go test -race ./...). go test ./pkg/github -run 'Test_CommentVisibilityToolSchemas|TestCommentVisibilityTypedInputSchemaMatchesLegacy|TestCommentVisibilityProtocols|TestCommentVisibilityProtocolGating|TestNormalizeCommentVisibilityInput|Test_HideAndUnhideComments' -count=1 passed. UPDATE_TOOLSNAPS=true go test ./pkg/github -run 'Test_CommentVisibilityToolSchemas|TestGranularToolSnaps' -count=1 passed when updating the six relevant snapshots. Live PAT-dependent e2e tests were not run.

Docs

  • Not needed
  • Updated (README / docs / examples)
    script/generate-docs passed; all generated documentation remained unchanged. Input schema and tool names/descriptions are unchanged, and the related output snapshots document the added API surface.

@SamMorrowDrums
SamMorrowDrums added this pull request to stack #3385 October 2, 2026 10:03
@SamMorrowDrums
SamMorrowDrums marked this pull request as ready for review October 2, 2026 10:05
@SamMorrowDrums
SamMorrowDrums requested a review from a team as a code owner October 2, 2026 10:05
Copilot AI balanced review requested due to automatic review settings October 2, 2026 10:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
SamMorrowDrums force-pushed the sammorrowdrums-typed-comment-visibility-tools branch from 65bbe67 to 9c35bd3 Compare October 2, 2026 10:18
@SamMorrowDrums
SamMorrowDrums force-pushed the sammorrowdrums-typed-comment-visibility-tools branch from 9c35bd3 to a4e5b24 Compare October 2, 2026 10:24
@SamMorrowDrums
SamMorrowDrums force-pushed the sammorrowdrums-typed-comment-visibility-tools branch from a4e5b24 to d593079 Compare October 2, 2026 10:37
@SamMorrowDrums
SamMorrowDrums force-pushed the sammorrowdrums-typed-comment-visibility-tools branch from 0f312ad to 43f5bcb Compare October 2, 2026 10:59
@SamMorrowDrums
SamMorrowDrums force-pushed the sammorrowdrums-typed-comment-visibility-tools branch from 17a8525 to 603c895 Compare October 2, 2026 11:13
SamMorrowDrums and others added 2 commits October 2, 2026 22:24
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
SamMorrowDrums force-pushed the sammorrowdrums-typed-comment-visibility-tools branch from 603c895 to 7e9c697 Compare October 2, 2026 20:50
Auto-generated by license-check workflow
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

⚠️ License files need updating

The license files are out of date. I tried to fix them automatically but don't have permission to push to this branch.

Please run:

script/licenses
git add third-party-licenses.*.md third-party/
git commit -m "chore: regenerate license files"
git push

Alternatively, enable "Allow edits by maintainers" in the PR settings so I can fix it automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants