Repository navigation
Closed
Labels
Description
General Goal
This is the second stage of implementing follow-up changes from PR comments. This issue focuses on creating a new worker task to handle these requests.
This issue is dependent on Issue #40 . Check the last commit for current implementation details.
Task Description
A new worker processor needs to be created in src/worker.js to handle jobs of type processPullRequestComment. This worker will check out the existing PR branch, use an LLM to generate code changes based on the comment, and then commit and push these changes to the same branch.
Implementation Steps
-
Update
src/worker.js:- Add a new case in the job processing logic to handle
processPullRequestCommentjobs. You might want to refactor the maincreateWorkercall to handle different job types more elegantly. - Create a new async function,
processPullRequestCommentJob(job).
- Add a new case in the job processing logic to handle
-
Implement
processPullRequestCommentJob:- This function should perform the following steps:
- Extract
pullRequestNumber,commentBody,branchName, etc., from the job data. - Clone/update the repository and check out the existing
branchName. Do not create a new branch. - Generate a new, specific prompt for the LLM. This prompt should instruct the agent to:
- Analyze the existing code on the branch.
- Implement the changes requested in the
commentBody. - Not create a new pull request.
- The prompt could be something like:
\"Given the existing changes on this branch, please implement the following additional request: {commentBody}. Commit the changes to the current branch.\"
- Execute
claudeService.executeClaudeCodewith this new prompt. The LLM to use can be determined from thellmfield in the job data. - After the agent runs, check for changes in the worktree.
- If there are changes, create a new commit and push it to the
branchName. The commit message should reference the original issue and the follow-up comment. - Add a comment to the pull request to confirm that the follow-up changes have been applied, referencing the new commit hash.
- Extract
- This function should perform the following steps:
Acceptance Criteria
- The worker correctly processes
processPullRequestCommentjobs. - The correct PR branch is checked out.
- The LLM is called with the correct prompt and implements the requested changes.
- A new commit is successfully pushed to the PR branch.
- A confirmation comment is posted on the PR.
Activity
integry commentedon Jul 21, 2025
Suggested Implementation for `src/worker.js`
Here's a high-level structure for the new worker processor. This would be added to
src/worker.jsand integrated into the main worker logic.propr-dev commentedon Jul 22, 2025
🤖 AI processing has started for this issue using opus model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
opusai-fix/41-feat-implement-worker-for-20250722-1039-opus-o9cmainissue-41-20250722-1039-opus-o9cfix(ai): Resolve issue #41 - Feat: Implement worker for follow-up PR …
Merge pull request #43 from integry/ai-fix/41-feat-implement-worker-f…