From 026cc7a27691865188886ce9ac7f766011a6691a Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Tue, 17 Mar 2026 20:09:33 +0000 Subject: [PATCH] skip empty review submissions instead of posting noise when create_pull_request_review is called with no body and no inline comments, return early with a clear log message instead of hitting GitHub's 422 or posting a useless "approved" comment. Made-with: Cursor --- entry | 10 ++++++++++ mcp/review.ts | 12 ++++++++++++ 2 files changed, 22 insertions(+) diff --git a/entry b/entry index c2151d6..95b3598 100755 --- a/entry +++ b/entry @@ -146909,6 +146909,16 @@ function CreatePullRequestReviewTool(ctx) { execute: execute(async ({ pull_number, body, approved, commit_id, comments = [] }) => { if (body) body = fixDoubleEscapedString(body); ctx.toolState.issueNumber = pull_number; + if (!body && comments.length === 0) { + log.info( + "review has no body and no inline comments \u2014 skipping submission (no issues found)" + ); + return { + success: true, + skipped: true, + reason: "no issues found \u2014 nothing to post" + }; + } let event = approved ? "APPROVE" : "COMMENT"; if (event === "APPROVE" && !ctx.prApproveEnabled) { log.info("prApproveEnabled is disabled \u2014 downgrading APPROVE to COMMENT"); diff --git a/mcp/review.ts b/mcp/review.ts index b4d10d9..39509c3 100644 --- a/mcp/review.ts +++ b/mcp/review.ts @@ -84,6 +84,18 @@ export function CreatePullRequestReviewTool(ctx: ToolContext) { // set issue context (PRs are issues) ctx.toolState.issueNumber = pull_number; + // skip empty reviews (no body, no inline comments) — nothing to post + if (!body && comments.length === 0) { + log.info( + "review has no body and no inline comments — skipping submission (no issues found)" + ); + return { + success: true, + skipped: true, + reason: "no issues found — nothing to post", + }; + } + // enforce prApproveEnabled: downgrade APPROVE to COMMENT if disabled let event: "APPROVE" | "COMMENT" = approved ? "APPROVE" : "COMMENT"; if (event === "APPROVE" && !ctx.prApproveEnabled) {