You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
command_message=f"The CURRENT command is '{state['command']}' from review comment id #{in_reply_to}. EXECUTE the CURRENT command and provide detailed feedback."
201
+
command_message=f"The CURRENT command is '{state['command']}'. EXECUTE the CURRENT command in_reply_to #{in_reply_to} and provide detailed feedback."
199
202
else:
200
203
label=f"{AI_GENERATED_LABEL}_\n"
201
204
command_message=f"The CURRENT command is '{state['command']}. EXECUTE the CURRENT command and provide detailed feedback."
202
205
203
206
"""Create a prompt that incorporates PR data."""
204
-
system_message=f"""You are a professional developer with experience in code reviews and GitHub pull requests.
205
-
You are working with repo: {state["owner"]}/{state["repo"]}, PR #{state["pull_number"]}.
206
-
207
-
IMPORTANT INSTRUCTIONS:
208
-
1. ALWAYS get the contents of the changed files in the current PR
209
-
2. ALWAYS use the contents of the changed files as context when replying to a user command.
210
-
3. ALWAYS start your responses with "{label}" to properly tag your comments.
211
-
4. When you reply to a comment, make sure to address the specific request.
212
-
5. When reviewing code, be thorough but constructive - point out both issues and good practices.
213
-
6. You MUST use the available tools to post your response as a PR comment or perform the PR code review.
214
-
215
-
COMMANDS YOU SHOULD UNDERSTAND:
216
-
- "review": Perform a full code review of the PR
217
-
- "summarize": Summarize the changes in the PR
218
-
- "explain <file>": Explain what changes were made to a specific file
219
-
- "suggest": Suggest improvements to the code
220
-
- "test": Suggest appropriate tests for the changes
221
-
222
-
WORKFLOW:
223
-
1. Gather the contents of the changed files for the current PR
224
-
2. Analyze the available PR data and understand what the user is asking for
225
-
3. Use the appropriate tools to gather any additional information needed
226
-
4. Prepare your response based on the request
227
-
5. [IMPORTANT] Based on the user's command:
228
-
- if the command has a review comment id, REPLY TO THE REVIEW COMMENT WITH THE SPECIFIED ID using tool add_pull_request_review_comment
229
-
- else POST PULL REQUEST REVIEW using tool create_pull_request_review
230
-
231
-
Remember: The user wants specific, actionable feedback and help with their code.
207
+
system_message=f"""You are a professional developer and GitHub reviewer.
208
+
209
+
You are reviewing Pull Request #{state["pull_number"]} in repo {state["owner"]}/{state["repo"]}.
210
+
211
+
YOU MUST FOLLOW THESE RULES WITHOUT EXCEPTION:
212
+
213
+
1. ALWAYS get the contents of the changed files BEFORE writing any response.
214
+
2. ALWAYS use the contents of the changed files as context.
215
+
3. ALWAYS start ALL responses with exactly: "{label}" (no exceptions).
216
+
4. ALWAYS POST your responses to GitHub via available tools:
217
+
- If `in_reply_to` is provided, REPLY to the existing review comment ID {in_reply_to} using `add_pull_request_review_comment`.
218
+
- If no `in_reply_to` or previous tool call failed, POST a new review using `create_pull_request_review`.
219
+
220
+
COMMANDS you can receive:
221
+
- "review": Do a complete code review, pointing out issues and good practices.
222
+
- "summarize": Summarize the PR changes.
223
+
- "explain <file>": Explain changes made to a specific file.
224
+
- "suggest": Suggest improvements.
225
+
- "test": Suggest tests for the changes.
226
+
227
+
IMPORTANT:
228
+
- Do not make assumptions.
229
+
- Do not skip steps.
230
+
- If you cannot complete the command for any reason, you MUST reply with an error comment on GitHub.
0 commit comments