Skip to content

feat(mcp): integrate review_pr into parse_mode EVAL dispatch#1414

Merged
JeremyDev87 merged 1 commit into
masterfrom
feat/review-context-eval-dispatch-1411
Apr 6, 2026
Merged

feat(mcp): integrate review_pr into parse_mode EVAL dispatch#1414
JeremyDev87 merged 1 commit into
masterfrom
feat/review-context-eval-dispatch-1411

Conversation

@JeremyDev87

Copy link
Copy Markdown
Owner

Summary

  • Add ReviewContext type to keyword.types.ts with detected, pr_number, issue_number?, and hint fields
  • Add buildReviewContext() method to mode.handler.ts — only activates for EVAL mode
  • Extract PR number from EVAL prompt via regex (PR #N, PR N, pull request #N)
  • Extract optional issue number (issue #N) for linked issue context
  • Return reviewContext in parse_mode response with ready-to-use review_pr tool call hint

Test plan

  • PR detected: EVAL: review PR #42 → reviewContext with pr_number=42
  • PR without hash: EVAL: review PR 100 → reviewContext with pr_number=100
  • PR + issue: EVAL: review PR #42 issue #1364 → includes issue_number=1364
  • Pull request keyword: EVAL: review pull request #55 → detected
  • No PR reference: EVAL: evaluate implementation quality → reviewContext undefined
  • Non-EVAL mode: PLAN: design PR #42 review feature → reviewContext undefined
  • Malformed: EVAL: review PR abc → reviewContext undefined
  • All 6164 tests passing, 0 failures
  • Build, typecheck, lint, format, circular checks passing

Closes #1411

- 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
@JeremyDev87 JeremyDev87 added feat mcp-server apps/mcp-server P1 Priority 1: First Impression labels Apr 6, 2026
@vercel

vercel Bot commented Apr 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Apr 6, 2026 4:53pm

@JeremyDev87 JeremyDev87 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 reviewContext with dynamic hint string (includes/excludes issue_number)
  • ✅ Returns undefined for non-EVAL modes and non-PR prompts

Code Quality

  • No any types, no unused imports
  • isNaN guard after parseInt — 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

  1. PR #N → detected (pr_number=42)
  2. PR N (no hash) → detected (pr_number=100)
  3. PR + issue → both extracted (pr_number=42, issue_number=1364)
  4. "pull request" keyword → detected (pr_number=55)
  5. No PR reference → undefined
  6. Non-EVAL mode with PR → undefined
  7. Malformed PR ref → undefined

Issues Found: 0

No Critical, High, Medium, or Low issues found.

Recommendation: APPROVE

@JeremyDev87 JeremyDev87 left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Review complete - review agent approved. Issues: 0.

@JeremyDev87 JeremyDev87 self-assigned this Apr 6, 2026
@JeremyDev87 JeremyDev87 merged commit 88bd097 into master Apr 6, 2026
26 checks passed
@JeremyDev87 JeremyDev87 deleted the feat/review-context-eval-dispatch-1411 branch April 6, 2026 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat mcp-server apps/mcp-server P1 Priority 1: First Impression

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(mcp): integrate review_pr into parse_mode EVAL dispatch

1 participant