Skip to content

Commit dac1776

Browse files
plwaltersclaude
andcommitted
fix: address PR feedback for resolve/unresolve thread methods
- Document that owner/repo/pullNumber are unused for resolve_thread and unresolve_thread methods - Note idempotency behavior (resolving already-resolved is a no-op) - Add test cases for fully omitted threadId (not just empty string) - Update toolsnaps to match updated descriptions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b0cc806 commit dac1776

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

pkg/github/__toolsnaps__/pull_request_review_write.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"annotations": {
33
"title": "Write operations (create, submit, delete) on pull request reviews."
44
},
5-
"description": "Create and/or submit, delete review of a pull request.\n\nAvailable methods:\n- create: Create a new review of a pull request. If \"event\" parameter is provided, the review is submitted. If \"event\" is omitted, a pending review is created.\n- submit_pending: Submit an existing pending review of a pull request. This requires that a pending review exists for the current user on the specified pull request. The \"body\" and \"event\" parameters are used when submitting the review.\n- delete_pending: Delete an existing pending review of a pull request. This requires that a pending review exists for the current user on the specified pull request.\n- resolve_thread: Resolve a review thread. Requires \"threadId\" parameter with the thread's node ID (e.g., PRRT_kwDOxxx).\n- unresolve_thread: Unresolve a previously resolved review thread. Requires \"threadId\" parameter.\n",
5+
"description": "Create and/or submit, delete review of a pull request.\n\nAvailable methods:\n- create: Create a new review of a pull request. If \"event\" parameter is provided, the review is submitted. If \"event\" is omitted, a pending review is created.\n- submit_pending: Submit an existing pending review of a pull request. This requires that a pending review exists for the current user on the specified pull request. The \"body\" and \"event\" parameters are used when submitting the review.\n- delete_pending: Delete an existing pending review of a pull request. This requires that a pending review exists for the current user on the specified pull request.\n- resolve_thread: Resolve a review thread. Requires only \"threadId\" parameter with the thread's node ID (e.g., PRRT_kwDOxxx). The owner, repo, and pullNumber parameters are not used for this method. Resolving an already-resolved thread is a no-op.\n- unresolve_thread: Unresolve a previously resolved review thread. Requires only \"threadId\" parameter. The owner, repo, and pullNumber parameters are not used for this method. Unresolving an already-unresolved thread is a no-op.\n",
66
"inputSchema": {
77
"properties": {
88
"body": {

pkg/github/pullrequests.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1485,8 +1485,8 @@ Available methods:
14851485
- create: Create a new review of a pull request. If "event" parameter is provided, the review is submitted. If "event" is omitted, a pending review is created.
14861486
- submit_pending: Submit an existing pending review of a pull request. This requires that a pending review exists for the current user on the specified pull request. The "body" and "event" parameters are used when submitting the review.
14871487
- delete_pending: Delete an existing pending review of a pull request. This requires that a pending review exists for the current user on the specified pull request.
1488-
- resolve_thread: Resolve a review thread. Requires "threadId" parameter with the thread's node ID (e.g., PRRT_kwDOxxx).
1489-
- unresolve_thread: Unresolve a previously resolved review thread. Requires "threadId" parameter.
1488+
- resolve_thread: Resolve a review thread. Requires only "threadId" parameter with the thread's node ID (e.g., PRRT_kwDOxxx). The owner, repo, and pullNumber parameters are not used for this method. Resolving an already-resolved thread is a no-op.
1489+
- unresolve_thread: Unresolve a previously resolved review thread. Requires only "threadId" parameter. The owner, repo, and pullNumber parameters are not used for this method. Unresolving an already-unresolved thread is a no-op.
14901490
`),
14911491
Annotations: &mcp.ToolAnnotations{
14921492
Title: t("TOOL_PULL_REQUEST_REVIEW_WRITE_USER_TITLE", "Write operations (create, submit, delete) on pull request reviews."),

pkg/github/pullrequests_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3499,6 +3499,30 @@ func TestResolveReviewThread(t *testing.T) {
34993499
expectToolError: true,
35003500
expectedToolErrMsg: "threadId is required",
35013501
},
3502+
{
3503+
name: "omitted threadId for resolve",
3504+
requestArgs: map[string]any{
3505+
"method": "resolve_thread",
3506+
"owner": "owner",
3507+
"repo": "repo",
3508+
"pullNumber": float64(42),
3509+
},
3510+
mockedClient: githubv4mock.NewMockedHTTPClient(),
3511+
expectToolError: true,
3512+
expectedToolErrMsg: "threadId is required",
3513+
},
3514+
{
3515+
name: "omitted threadId for unresolve",
3516+
requestArgs: map[string]any{
3517+
"method": "unresolve_thread",
3518+
"owner": "owner",
3519+
"repo": "repo",
3520+
"pullNumber": float64(42),
3521+
},
3522+
mockedClient: githubv4mock.NewMockedHTTPClient(),
3523+
expectToolError: true,
3524+
expectedToolErrMsg: "threadId is required",
3525+
},
35023526
{
35033527
name: "thread not found",
35043528
requestArgs: map[string]any{

0 commit comments

Comments
 (0)