Skip to content

feat: include file path and line number in PR review comments#82

Merged
neekolas merged 1 commit intoxmtplabs:mainfrom
xmtp-coder-agent:fix/issue-81
Mar 30, 2026
Merged

feat: include file path and line number in PR review comments#82
neekolas merged 1 commit intoxmtplabs:mainfrom
xmtp-coder-agent:fix/issue-81

Conversation

@xmtp-coder-agent
Copy link
Copy Markdown
Collaborator

@xmtp-coder-agent xmtp-coder-agent commented Mar 30, 2026

Resolves #81

Summary

  • Extracts path and line from pull_request_review_comment webhook payloads
  • Adds a File: <path>:<line> line to the formatted message sent to Coder tasks
  • Only appears for inline review comments (not general PR comments or review submissions)

Changes

  • src/webhook-router.ts — Extract filePath and lineNumber from review comment payloads
  • src/webhook-router.ts — Add optional fields to PRCommentContext type
  • src/handler-dispatcher.ts — Pass new fields through to handler
  • src/handlers/pr-comment.ts — Add fields to interface and forward to message formatter
  • src/messages.ts — Include File: line in output when file path is present

Example output

New Comment on PR: https://github.com/org/repo/pull/1#comment-1
Commenter: reviewer
Timestamp: 2026-03-17T12:00:00Z
File: src/handlers/pr-comment.ts:42

[INSTRUCTIONS]
...

Test plan

  • New test: formatPRCommentMessage includes file path and line number
  • New test: formatPRCommentMessage includes file path without line number
  • New test: formatPRCommentMessage omits file line when not provided
  • New test: PR comment handler includes file/line in forwarded review comment
  • New test: Webhook router extracts filePath and lineNumber from review comment fixture
  • All 187 tests pass, typecheck/lint/format clean

Note

Include file path and line number in PR review comment messages

  • Extends PRCommentContext and CommentMessageParams with optional filePath and lineNumber fields, populated from the webhook payload's comment.path and comment.line.
  • formatPRCommentMessage now appends a File: <path>[:<line>] line to the formatted message when filePath is present.
  • The WebhookRouter extracts these fields from pull_request_review_comment events and passes them through to the handler via the dispatch context.

Macroscope summarized a4a1bce.

When a PR review comment is forwarded to a Coder task, the message now
includes the file path and line number where the comment was placed,
giving the agent the context it needs to locate the code in question.

Resolves xmtplabs#81

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@neekolas neekolas merged commit 1abad36 into xmtplabs:main Mar 30, 2026
4 checks passed
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.

PR Comments lack context

2 participants