Skip to content

Commit 2e2096c

Browse files
committed
Fix: Correct GitHub API instructions for comment responses
Address review feedback: GitHub issue/PR timeline comments don't support threaded replies. Updated the agent prompt to: - Remove reference to non-existent /issues/comments/{id}/replies endpoint - Clarify that issue comments require creating new comments with references - Keep in_reply_to for PR review comments (which do support threading) - Update workflow instructions to be consistent with correct API usage
1 parent bac7ea5 commit 2e2096c

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

src/utils/prompt.ts

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,31 @@ Important: How you handle changes depends on the context:
66
- If you are working on a Pull Request (PR): You are allowed to commit directly to that PR's branch.
77
- If you are working on a GitHub Issue: You must create a new branch and open a Pull Request with your changes.
88
9-
CRITICAL - Replying to Comments:
10-
When this action is triggered by a user comment, you MUST reply to that specific comment (not create a new standalone comment).
9+
CRITICAL - Responding to Comments:
10+
When this action is triggered by a user comment, you should acknowledge the triggering comment in your response.
1111
- A "Triggering Comment ID" will be provided in the prompt context.
12-
- Use this comment ID to create a REPLY to that comment using the GitHub API.
13-
- For issue comments: Use POST /repos/{owner}/{repo}/issues/comments/{comment_id}/replies or reference the comment in your reply.
14-
- For PR review comments: Use POST /repos/{owner}/{repo}/pulls/{pull_number}/comments with the \`in_reply_to\` parameter set to the triggering comment ID.
15-
- This ensures your response appears as a threaded reply to the user's original comment, making the conversation easy to follow.
16-
- If no triggering comment ID is provided, you may create a new comment.
12+
- Use the github-api tool to interact with GitHub.
13+
14+
How to respond depends on the comment type:
15+
16+
1. For issue/PR timeline comments (most common):
17+
- GitHub issue comments do NOT support threaded replies - there is no reply endpoint.
18+
- Create a new comment using: POST /repos/{owner}/{repo}/issues/{issue_number}/comments
19+
- In your comment body, reference the triggering comment by quoting it or linking to it.
20+
- Example: Start your comment with "> Replying to [comment](link):" or quote the relevant text.
21+
22+
2. For PR review comments (inline code comments):
23+
- These DO support threaded replies via the \`in_reply_to\` parameter.
24+
- Use: POST /repos/{owner}/{repo}/pulls/{pull_number}/comments with \`in_reply_to\` set to the triggering comment ID.
25+
26+
If no triggering comment ID is provided, simply create a new comment on the issue/PR.
1727
1828
Your workflow:
19-
1. Reply to the triggering comment to let the user know you're starting to work on it.
20-
- IMPORTANT: Use the Triggering Comment ID to reply directly to that comment (see above).
29+
1. Post a comment acknowledging the user's request and let them know you're starting to work on it.
30+
- Reference the triggering comment (see instructions above for how to respond to comments).
2131
2. Read the PR context and understand the request.
2232
3. Create a Todo List:
23-
- Update your reply comment with a todo list of what you're going to do. (Use the github-api tool to update your reply comment.)
33+
- Update your comment with a todo list of what you're going to do. (Use the github-api tool with PATCH /repos/{owner}/{repo}/issues/comments/{comment_id} to update your comment.)
2434
- Use your GitHub comment to maintain a detailed task list based on the request.
2535
- Format todos as a checklist (- [ ] for incomplete, - [x] for complete).
2636
- Update the comment with each task completion.
@@ -39,7 +49,7 @@ Your workflow:
3949
- Files modified
4050
- Links to PRs/commits
4151
5. Final Comment Update (IMPORTANT):
42-
- When you are completely done with all tasks, update your reply comment ONE FINAL TIME.
52+
- When you are completely done with all tasks, update your comment ONE FINAL TIME.
4353
- REMOVE the entire task list/checklist from the comment.
4454
- Replace the comment body with ONLY a concise, minimal final summary.
4555
- Keep it brief: just state what was attempted and what was done.

0 commit comments

Comments
 (0)