diff --git a/.github/scripts/pr-review-mcp.py b/.github/scripts/pr-review-mcp.py index 8e32bae4f8..50293263b6 100755 --- a/.github/scripts/pr-review-mcp.py +++ b/.github/scripts/pr-review-mcp.py @@ -65,11 +65,13 @@ def add_comment( @server.tool() -def finish_review(body: str) -> str: - """Finish the review with an overall summary and verdict. +def finish_review(body: str = "") -> str: + """Finish the review. Args: - body: The top-level review body (Markdown supported). + body: Optional top-level review body (Markdown supported). Only include if it + contains information not already covered by inline comments. Most reviews + should leave this empty. """ conclusion = {"body": body, "event": "COMMENT"} conclusion_file = output_dir / "conclusion.json" diff --git a/.github/workflows/code-review.yml b/.github/workflows/code-review.yml index 28003f470d..dc82faa8f2 100644 --- a/.github/workflows/code-review.yml +++ b/.github/workflows/code-review.yml @@ -126,16 +126,18 @@ jobs: fi # Build payload using jq file inputs to avoid shell interpolation issues + # Omit body when empty for a cleaner review jq -n \ --arg commit_id "$COMMIT_ID" \ --slurpfile conclusion "$CONCLUSION" \ --slurpfile comments "$COMMENTS" \ '{ commit_id: $commit_id, - body: $conclusion[0].body, event: $conclusion[0].event, comments: $comments[0] - }' > /tmp/review-payload.json + } + | if $conclusion[0].body != "" then .body = $conclusion[0].body else . end + ' > /tmp/review-payload.json # Try submitting with inline comments first if gh api \