feat(mcp): integrate review_pr into parse_mode EVAL dispatch#1414
Merged
Conversation
- Add ReviewContext type to keyword.types.ts - Add buildReviewContext() to mode.handler.ts for EVAL-only PR detection - Extract PR number via regex (PR #N, PR N, pull request #N) - Extract optional issue number (issue #N) - Return reviewContext with hint for review_pr tool call - Add 7 tests: PR detected, no hash, PR+issue, pull request, no PR, non-EVAL, malformed Closes #1411
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
JeremyDev87
commented
Apr 6, 2026
JeremyDev87
left a comment
Owner
Author
There was a problem hiding this comment.
Review: APPROVE
CI Status: PASS (26/26)
Spec Compliance (#1411)
All 5 acceptance criteria met:
- ✅
buildReviewContext()detects PR review context in EVAL prompts only - ✅ Extracts PR number via regex (
PR #N,PR N,pull request #N) - ✅ Optional issue number extraction (
issue #N) - ✅ Returns
reviewContextwith dynamichintstring (includes/excludes issue_number) - ✅ Returns
undefinedfor non-EVAL modes and non-PR prompts
Code Quality
- No
anytypes, no unused imports isNaNguard afterparseInt— graceful malformed input handling- Spread pattern
...(reviewContext && { reviewContext })consistent with handler - JSDoc on type and method
- Private method — clean encapsulation
Test Coverage: 7/7 scenarios
- PR #N → detected (pr_number=42)
- PR N (no hash) → detected (pr_number=100)
- PR + issue → both extracted (pr_number=42, issue_number=1364)
- "pull request" keyword → detected (pr_number=55)
- No PR reference → undefined
- Non-EVAL mode with PR → undefined
- Malformed PR ref → undefined
Issues Found: 0
No Critical, High, Medium, or Low issues found.
Recommendation: APPROVE
JeremyDev87
commented
Apr 6, 2026
JeremyDev87
left a comment
Owner
Author
There was a problem hiding this comment.
✅ Review complete - review agent approved. Issues: 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ReviewContexttype tokeyword.types.tswithdetected,pr_number,issue_number?, andhintfieldsbuildReviewContext()method tomode.handler.ts— only activates for EVAL modePR #N,PR N,pull request #N)issue #N) for linked issue contextreviewContextin parse_mode response with ready-to-usereview_prtool call hintTest plan
EVAL: review PR #42→ reviewContext with pr_number=42EVAL: review PR 100→ reviewContext with pr_number=100EVAL: review PR #42 issue #1364→ includes issue_number=1364EVAL: review pull request #55→ detectedEVAL: evaluate implementation quality→ reviewContext undefinedPLAN: design PR #42 review feature→ reviewContext undefinedEVAL: review PR abc→ reviewContext undefinedCloses #1411