-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Summary
Currently, Claude can only reply within an existing inline comment thread if it was directly triggered by a pull_request_review_comment event. There's no way for Claude to reply to existing inline threads when triggered by other events (e.g., issue comment, PR comment, workflow_dispatch).
Current Behavior
In src/github/operations/comments/create-initial.ts, the action uses createReplyForReviewComment only when the event is pull_request_review_comment:
} else if (isPullRequestReviewCommentEvent(context)) {
response = await octokit.rest.pulls.createReplyForReviewComment({
owner,
repo,
pull_number: context.entityNumber,
comment_id: context.payload.comment.id, // replies to triggering comment
body: initialBody,
});
}The github-inline-comment-server.ts provides create_inline_comment which can create new inline threads via createReviewComment, but it doesn't expose the in_reply_to parameter that would allow replying to existing threads.
Proposed Solution
Add an optional in_reply_to parameter to the create_inline_comment tool in src/mcp/github-inline-comment-server.ts:
in_reply_to: z
.number()
.optional()
.describe("Comment ID to reply to (creates a reply in an existing thread instead of a new thread)")GitHub's createReviewComment API supports this parameter: https://docs.github.com/en/rest/pulls/comments#create-a-review-comment-for-a-pull-request
This would allow Claude to:
- Read existing inline comment threads on a PR
- Reply to specific threads with follow-up responses
- Consolidate feedback in existing threads rather than creating duplicates
Use Case
When the review action is triggered multiple times on the same PR (e.g., after each push), Claude currently creates separate inline comment threads for the same issues each time. This results in N duplicate threads for the same problem, each requiring separate resolution.
With this feature, Claude could instead reply to the existing thread with a message like "This issue from the previous review still hasn't been addressed" - keeping all feedback about a specific line consolidated in one thread.
Related Issues
- Inline comments for reviews #60 - Inline comments for reviews (general inline comment support)
- Action doesn't create inline comments on specific lines of the changed files #711 - Action doesn't create inline comments on specific lines (duplicate of Inline comments for reviews #60)