Skip to content

Conversation

@plwalters
Copy link

Summary

Adds resolve_thread and unresolve_thread methods to the pull_request_review_write tool, enabling users to resolve and unresolve PR review threads via GraphQL mutations.

Why

Fixes #1768

What changed

  • Added ThreadID field to PullRequestReviewWriteParams struct
  • Added threadId parameter and new methods to tool schema
  • Implemented ResolveReviewThread function using GraphQL resolveReviewThread and unresolveReviewThread mutations
  • Added switch cases for resolve_thread and unresolve_thread methods
  • Added unit tests covering success and error scenarios
  • Updated toolsnaps and generated docs

MCP impact

  • No tool or API changes
  • Tool schema or behavior changed — Added two new methods (resolve_thread, unresolve_thread) and a new threadId parameter to the existing pull_request_review_write tool.
  • New tool added

Prompts tested (tool changes only)

Security / limits

  • No security or limits impact — Uses existing GraphQL client authentication; thread resolution is already permission-controlled by GitHub.
  • Auth / permissions considered
  • Data exposure, filtering, or token/size limits considered

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

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

Docs

  • Not needed
  • Updated (README / docs / examples) — Auto-generated via script/generate-docs

@plwalters plwalters requested a review from a team as a code owner January 28, 2026 17:25
@dsculptor
Copy link

Clean PR — extends the existing tool correctly, uses the right GraphQL mutations, and tests cover the key cases. Ready for merge with minor notes:

  1. Unused required paramsowner/repo/pullNumber are silently ignored for resolve_thread/unresolve_thread. A one-liner in the method description would prevent confusion.
  2. Test gapthreadId: "" is tested, but fully omitted threadId isn't. Go zero-value likely handles it, but worth an explicit case.
  3. Idempotency — Worth noting in the method description that resolving an already-resolved thread is a no-op, so agents don't add unnecessary guard logic.
  4. Minor DRY opportunity — Resolve/unresolve branches share nearly identical mutation structs. Not a blocker.

Nice work filling a real gap in the PR review workflow.

@plwalters plwalters force-pushed the feat/resolve-review-threads branch from 08aa18b to dac1776 Compare February 10, 2026 20:24
Adds `resolve_thread` and `unresolve_thread` methods to the
`pull_request_review_write` tool, enabling users to resolve and
unresolve PR review threads via GraphQL mutations.

- Add ThreadID field to PullRequestReviewWriteParams struct
- Add threadId parameter and new methods to tool schema
- Implement ResolveReviewThread function using GraphQL mutations
- Add switch cases for resolve_thread and unresolve_thread methods
- Add unit tests covering success, error, empty and omitted threadId
- Document that owner/repo/pullNumber are unused for these methods
- Document idempotency (resolving already-resolved is a no-op)
- Update toolsnaps and generated docs

Fixes github#1768

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@plwalters plwalters force-pushed the feat/resolve-review-threads branch from dac1776 to 1fdfa13 Compare February 10, 2026 20:25
@plwalters
Copy link
Author

I believe the feedback should be addressed. I'm not a frequent contributor to this repo so if there is anything I need to amend just let me know! I squashed the commits as well

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.

Add support for resolving/unresolving PR review threads

2 participants