Skip to content

Commit 5816973

Browse files
Support code suggestions in @gemini-cli /review (#66)
### Description Enable GitHub PR suggestions in inline comments ### Approach This PR tells the `@gemini-cli /review` agent to prefer GitHub suggestions. So instead of the model posting a comment like: ``` You should change this line to: <NEW CODE> ``` It should instead follow the format: ```` You should change this line to ```suggestion <NEW CODE> ``` ```` ### Testing Ran this action on an example PR and see the suggestions (boxed for convenience): <img width="629" height="1270" alt="image" src="https://github.com/user-attachments/assets/f67199e6-2c12-4fa8-82f8-b43356f30349" />
1 parent 9a31546 commit 5816973

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/gemini-pr-review.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@ jobs:
238238
detailed review feedback here>")
239239
2. Posting the review:
240240
2.1 Use the mcp__github__create_pending_pull_request_review to create a Pending Pull Request Review.
241-
2.2 Use the mcp__github__add_comment_to_pending_review to add comments to the Pending Pull Request Review. Inline comments are preffered whenever possible, so repeat this step, calling mcp__github__add_comment_to_pending_review, as needed. All comments about specific lines of code should use inline comments.
241+
2.2 Use the mcp__github__add_comment_to_pending_review to add comments to the Pending Pull Request Review. Inline comments are preffered whenever possible, so repeat this step, calling mcp__github__add_comment_to_pending_review, as needed. All comments about specific lines of code should use inline comments. It is preferred to use code suggestions when possible, which include a code block that is labeled "suggestion", which contains what the new code should be. An example is:
242+
{{COMMENT_TEXT}}
243+
```suggestion
244+
{{CODE_SUGGESTION}}
245+
```
242246
2.3 Use the mcp__github__submit_pending_pull_request_review to submit the Pending Pull Request Review.
243247
244248
Review Areas:

workflows/pr-review/gemini-pr-review.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,11 @@ jobs:
238238
detailed review feedback here>")
239239
2. Posting the review:
240240
2.1 Use the mcp__github__create_pending_pull_request_review to create a Pending Pull Request Review.
241-
2.2 Use the mcp__github__add_comment_to_pending_review to add comments to the Pending Pull Request Review. Inline comments are preffered whenever possible, so repeat this step, calling mcp__github__add_comment_to_pending_review, as needed. All comments about specific lines of code should use inline comments.
241+
2.2 Use the mcp__github__add_comment_to_pending_review to add comments to the Pending Pull Request Review. Inline comments are preffered whenever possible, so repeat this step, calling mcp__github__add_comment_to_pending_review, as needed. All comments about specific lines of code should use inline comments. It is preferred to use code suggestions when possible, which include a code block that is labeled "suggestion", which contains what the new code should be. An example is:
242+
{{COMMENT_TEXT}}
243+
```suggestion
244+
{{CODE_SUGGESTION}}
245+
```
242246
2.3 Use the mcp__github__submit_pending_pull_request_review to submit the Pending Pull Request Review.
243247
244248
Review Areas:

0 commit comments

Comments
 (0)