feat(github-work-app): add reaction tooling to github mcp#2130
feat(github-work-app): add reaction tooling to github mcp#2130miles-kt-inkeep merged 10 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
🦋 Changeset detectedLatest commit: 588a1dd The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
PR Review Summary
(11) Total Issues | Risk: High
🔴❗ Critical (5) ❗🔴
Inline Comments:
- 🔴 Critical:
utils.ts:1017Wrong API method name —deleteForPullRequestCommentshould bedeleteForPullRequestReviewComment - 🔴 Critical:
utils.ts:104Non-null assertion onreaction.user!.logincrashes on deleted users - 🔴 Critical:
utils.ts:136Same null safety issue as line 104 - 🔴 Critical:
schemas.ts:26-30Missingidfield makesremove-comment-reactionunusable - 🔴 Critical:
utils.ts:601-603Breaking change togeneratePrMarkdownoutput format (markdown → JSON)
🟠⚠️ Major (5) 🟠⚠️
🟠 1) scope Missing unit tests for new reaction functions
Issue: Six new utility functions were added (createIssueCommentReaction, deleteIssueCommentReaction, createPullRequestReviewCommentReaction, deletePullRequestReviewCommentReaction, fetchIssueCommentReactions, fetchReviewCommentReactions) with no corresponding tests. Existing tests in utils.test.ts cover similar functions.
Why: The tests reviewer identified a potential bug (deleteForPullRequestComment vs deleteForPullRequestReviewComment) that would have been caught by unit tests. Missing test coverage allows regressions and API contract violations to ship.
Fix: Add unit tests following the existing patterns in packages/agents-work-apps/src/__tests__/github/mcp/utils.test.ts. At minimum, test:
- Correct Octokit API method calls with proper parameters
- Return value extraction (id, content)
- Error propagation
- Null user handling
Refs:
🟠 2) scope Missing documentation for new MCP tools
Issue: Two new MCP tools (add-comment-reaction, remove-comment-reaction) are added but no customer-facing documentation exists. The GitHub MCP server currently provides 12+ tools with no tool-level documentation.
Why: Customers cannot discover these capabilities or understand how to use them. The comment_type parameter distinguishing issue_comment vs review_comment is particularly non-obvious without docs.
Fix: Add documentation for the GitHub MCP server tools, either as a new guide page or within the existing MCP documentation. Document:
- Available tools and their purposes
- Parameters (especially
comment_typeenum values and valid reactions) - That
add-comment-reactionreturns areaction_idneeded for removal
Refs:
Inline Comments:
- 🟠 Major:
index.ts:1044-1066Missing 403 error handling foradd-comment-reaction - 🟠 Major:
index.ts:1135Missing 403 error handling forremove-comment-reaction - 🟠 Major:
utils.ts:452-456Reactions fetch not wrapped in try-catch — failures crash entire operation - 🟠 Major:
utils.ts:486-490Same try-catch issue for review comment reactions - 🟠 Major:
.changeset:2Changeset should beminor(breaking change), notpatch
🟡 Minor (1) 🟡
Inline Comments:
- 🟡 Minor:
index.ts:1006Missing.describe()on reaction parameter
💭 Consider (1) 💭
💭 1) index.ts:1001-1005 comment_type enum naming
Issue: The comment_type enum values use GitHub API internal terminology (issue_comment, review_comment) which may confuse users unfamiliar with GitHub's API structure.
Why: From a customer perspective, both are "PR comments" — one is a general comment, one is an inline code comment. More intuitive values like general/inline or pr_comment/code_comment could improve discoverability.
Fix: Consider renaming the enum values and explaining the mapping in the description. This is a preference — the current values are technically accurate.
🚫 REQUEST CHANGES
Summary: This PR adds valuable reaction tooling but has several critical issues that need addressing before merge:
- Bug: Wrong API method name (
deleteForPullRequestComment→deleteForPullRequestReviewComment) will cause runtime failures - Broken workflow: Missing
idfield inReactionSchemamakesremove-comment-reactionunusable - Breaking change:
generatePrMarkdownoutput format changed from human-readable markdown to JSON — this appears unintentional and will break existing tests and consumers - Null safety: Non-null assertions on
reaction.userwill crash on deleted accounts - Missing tests: New functions lack coverage
I recommend addressing the critical issues (especially the API method name bug and the generatePrMarkdown change) before merging.
Discarded (3)
| Location | Issue | Reason Discarded |
|---|---|---|
schemas.ts:26-30 |
ReactionSchema.user could use GitHubUserSchema for consistency with CommentSchema.author |
Design consideration, not a bug — current string-based approach is simpler and sufficient |
utils.ts:105,137 |
Type assertion as Reaction['content'] bypasses runtime validation |
Low severity — GitHub's reaction types are stable; trade-off vs parsing overhead not warranted |
index.ts:1052 |
404 error message could include more helpful guidance | Merged with 403 handling suggestion; single error handling improvement covers both |
Reviewers (8)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
pr-review-standards |
3 | 0 | 0 | 0 | 3 | 0 | 0 |
pr-review-product |
5 | 0 | 1 | 0 | 2 | 0 | 2 |
pr-review-consistency |
6 | 0 | 0 | 0 | 3 | 0 | 1 |
pr-review-breaking-changes |
2 | 0 | 0 | 0 | 2 | 0 | 0 |
pr-review-docs |
1 | 1 | 0 | 0 | 0 | 0 | 0 |
pr-review-tests |
5 | 1 | 0 | 0 | 0 | 0 | 0 |
pr-review-types |
3 | 0 | 0 | 0 | 0 | 0 | 2 |
pr-review-errors |
6 | 0 | 0 | 0 | 4 | 0 | 0 |
| Total | 31 | 2 | 1 | 0 | 14 | 0 | 5 |
Note: Multiple reviewers flagged overlapping issues (API method name, null safety, breaking change) — findings were deduplicated and consolidated.
| markdown += `comments: ${JSON.stringify(issueComments)}\n`; | ||
| markdown += `Review summaries: ${JSON.stringify(reviewSummaries)}\n`; | ||
| markdown += `Inline review comments: ${JSON.stringify(reviewComments)}\n`; |
There was a problem hiding this comment.
🔴 CRITICAL: Breaking change to generatePrMarkdown output format
Issue: The comments section output changed from human-readable markdown to raw JSON.stringify() blobs. This breaks existing consumers of get-pull-request-details.
Why:
- Before: Formatted markdown that LLMs could easily parse:
[APPROVED] @reviewer (1/15/2026) LGTM! @commenter (1/15/2026) Fixed as requested src/file.ts: @reviewer line 42 (1/15/2026) Consider using const here - After: Raw JSON strings:
comments: [{"id":123,"body":"Fixed as requested",...}] Review summaries: [{"id":1,"body":"LGTM!",...}]
This significantly degrades usability for LLM agents and breaks any downstream parsing.
Fix: Restore the previous human-readable format. If reactions need to be included, append them inline per comment (e.g., Reactions: +1 (2), heart (1)) rather than switching to JSON.
Refs:
There was a problem hiding this comment.
PR Review Summary
(10) Total Issues | Risk: High
✅ Issues Resolved in This Update
The author addressed 3 critical issues from the prior review:
- ✅
utils.ts:104— Fixed null safety:reaction.user?.login ?? '[deleted]' - ✅
utils.ts:136— Fixed null safety: same pattern applied - ✅
utils.ts:1017— Fixed API method name:deleteForPullRequestReviewComment
These fixes are correct and properly implemented.
🕐 Pending Recommendations (10)
The following issues from the prior review remain unresolved:
Critical (2):
- 🔴
schemas.ts:26-30Missingidfield inReactionSchemamakesremove-comment-reactionunusable — users can't get reaction IDs to remove them - 🔴
utils.ts:601-603Breaking change togeneratePrMarkdownoutput format (human-readable markdown → JSON blobs)
Major (6):
- 🟠
index.ts:1044-1066Missing 403 error handling foradd-comment-reaction - 🟠
index.ts:1135Missing 403 error handling forremove-comment-reaction - 🟠
utils.ts:452-456Reactions fetch not wrapped in try-catch — failures crash entire operation - 🟠
utils.ts:486-490Same try-catch issue for review comment reactions - 🟠 Prior review Missing unit tests for new reaction functions
- 🟠 Prior review Missing documentation for new MCP tools
Minor (1):
- 🟡
index.ts:1006Missing.describe()on reaction parameter
Versioning (1):
- 🟠
.changeset:2Changeset should beminor(breaking change), notpatch
🚫 REQUEST CHANGES
Summary: Good progress — the 3 fixes in this update are correct. However, 2 critical issues remain unresolved:
ReactionSchemamissingidfield — Users cannot remove reactions because they can't obtain reaction IDs fromget-pull-request-detailsgeneratePrMarkdownbreaking change — Output switched from human-readable markdown to JSON, breaking existing consumers
Please address these critical issues. The 403 error handling and try-catch improvements are also important for production reliability but are lower priority.
Reviewers (0)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
| N/A — delta review | — | — | — | — | — | — | — |
Note: This was a delta-scoped re-review. The 3-line change was verified directly without dispatching subagent reviewers.
There was a problem hiding this comment.
PR Review Summary
(8) Total Issues | Risk: High
✅ Issues Resolved in This Update
Good progress! The following issues from prior reviews have been addressed:
- ✅
schemas.ts:27— Addedidfield toReactionSchema - ✅
index.ts:1005-1007— Added.describe()toreactionparameter - ✅
utils.ts:457-465— Added try-catch for issue comment reactions fetch - ✅
utils.ts:499-507— Added try-catch for review comment reactions fetch - ✅
index.ts:1073-1083— Added 403 error handling foradd-comment-reaction - ✅
.changeset— Updated tominorversion (though format is malformed) - ✅ Unit tests added for all 6 new reaction utility functions
- ✅ New
list-comment-reactionstool added — enables users to discover reaction IDs
🔴❗ Critical (1) ❗🔴
🔴 1) utils.ts:1035 + utils.test.ts:915,922,934 Regression: Invalid API method name
Issue: Commit 38b39b22b ("address feedback") changed the API method FROM deleteForPullRequestReviewComment TO deleteForPullRequestComment. This is the opposite of what the prior review suggested. The method deleteForPullRequestComment does not exist in Octokit.
Why: This will cause runtime errors when users try to remove reactions from PR review comments. The tests pass because they mock the same invalid method name — providing false confidence.
Fix: Revert to deleteForPullRequestReviewComment in both utils.ts and the test file (see inline comments with 1-click suggestions).
Refs:
Inline Comments:
- 🔴 Critical:
utils.ts:1035Invalid API method name (regression) - 🔴 Critical:
utils.test.ts:915Test mocks invalid method - 🔴 Critical:
utils.test.ts:922Test assertion uses invalid method - 🔴 Critical:
utils.test.ts:934Test mocks invalid method (error case)
🟠⚠️ Major (1) 🟠⚠️
Inline Comments:
- 🟠 Major:
.changeset/legal-silver-grouse.md:1-5Malformed frontmatter (4 delimiters instead of 2)
🕐 Pending Recommendations (4)
The following issues from prior reviews remain unresolved:
- 🔴
utils.ts:619-621Breaking change:generatePrMarkdownoutputs JSON blobs instead of human-readable markdown — still unaddressed - 🟠
index.ts:1150-1164Missing 403 error handling forremove-comment-reaction(only 404 is handled) - 🟠 Prior review Missing documentation for new MCP tools
- 💭 Prior review
comment_typeenum naming could be more user-friendly
🚫 REQUEST CHANGES
Summary: Good progress on addressing prior feedback — 8 issues were fixed! However, a critical regression was introduced: the deletePullRequestReviewCommentReaction function now calls an invalid Octokit method (deleteForPullRequestComment instead of deleteForPullRequestReviewComment). This will cause runtime failures.
Blocking issues:
- API method name regression — 1-click fixes provided in inline comments
- Malformed changeset — 1-click fix provided
Still pending from prior reviews:
generatePrMarkdownbreaking change (JSON output) — this is the most significant remaining issue- Missing 403 handling for
remove-comment-reaction
Discarded (0)
No findings were discarded in this delta review.
Reviewers (0)
| Reviewer | Returned | Main Findings | Consider | While You're Here | Inline Comments | Pending Recs | Discarded |
|---|---|---|---|---|---|---|---|
| N/A — delta review | — | — | — | — | — | — | — |
Note: This was a delta-scoped re-review analyzing commits 38b39b22b and 1ac22e04c. No subagent reviewers were dispatched — the delta was analyzed directly by the orchestrator.
| const mockOctokit = { | ||
| rest: { | ||
| reactions: { | ||
| deleteForPullRequestComment: vi.fn().mockResolvedValue({}), |
There was a problem hiding this comment.
🔴 CRITICAL: Test mocks invalid API method name
Issue: This test mocks deleteForPullRequestComment, but the correct Octokit method is deleteForPullRequestReviewComment. The test passes because it's mocking the same invalid method the implementation uses — but both are wrong.
Why: This test provides false confidence. It will pass even though the actual API call at runtime will fail because deleteForPullRequestComment doesn't exist.
Fix: Update to mock the correct method:
| deleteForPullRequestComment: vi.fn().mockResolvedValue({}), | |
| deleteForPullRequestReviewComment: vi.fn().mockResolvedValue({}), |
Refs:
|
|
||
| await deletePullRequestReviewCommentReaction(mockOctokit, 'owner', 'repo', 55, 202); | ||
|
|
||
| expect(mockOctokit.rest.reactions.deleteForPullRequestComment).toHaveBeenCalledWith({ |
There was a problem hiding this comment.
🔴 CRITICAL: Same issue — update to deleteForPullRequestReviewComment
| expect(mockOctokit.rest.reactions.deleteForPullRequestComment).toHaveBeenCalledWith({ | |
| expect(mockOctokit.rest.reactions.deleteForPullRequestReviewComment).toHaveBeenCalledWith({ |
| const mockOctokit = { | ||
| rest: { | ||
| reactions: { | ||
| deleteForPullRequestComment: vi.fn().mockRejectedValue(new Error('Not found')), |
There was a problem hiding this comment.
🔴 CRITICAL: Same issue — update to deleteForPullRequestReviewComment
| deleteForPullRequestComment: vi.fn().mockRejectedValue(new Error('Not found')), | |
| deleteForPullRequestReviewComment: vi.fn().mockRejectedValue(new Error('Not found')), |
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
be9034f to
9124e0b
Compare
|
test |
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
No description provided.