Skip to content

AI Fix for Issue #222: Refactor: Clean up 'starting work' comments after PR follow-up processing - #223

Closed
propr-dev[bot] wants to merge 4 commits into
mainfrom
ai-fix/222-refactor-clean-up-startin-20251106-1546-claude-sonnet-4-5-20250929-lev
Closed

propr-dev[bot] wants to merge 4 commits into
mainfrom
ai-fix/222-refactor-clean-up-startin-20251106-1546-claude-sonnet-4-5-20250929-lev

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #222

Model Used: claude-sonnet-4-5-20250929
Status: ✅ Implementation Completed
Branch: ai-fix/222-refactor-clean-up-startin-20251106-1546-claude-sonnet-4-5-20250929-lev
Commits: ✅ Changes committed (0d33c1a)


🤖 AI Processing Completed

Execution Details:

Summary:
Perfect! I've successfully implemented all the changes for issue #222:

Summary

Modified src/jobs/processPullRequestCommentJob.js to:

  1. Added reprocessing guard footer to completion comments (lines 536 & 584):

    • Both success-with-changes and success-with-no-changes completion comments now include the footer with checked comment IDs
    • Format: _Processing comment ID(s): {id}✓, {id}✓..._
  2. Added cleanup logic for starting work comment (lines 545-558 & 593-606):

    • After posting each completion comment, waits 3 seconds to ensure overlap
    • Deletes the initial "Starting work" comment
    • Includes proper error handling with logging

The implementation ensures the reprocessing guard is always present (transferred from the temporary comment to the final comment) and cleans up the redundant "starting work" comment, leaving only one final bot comment on the PR.

Claude Code Results:

  • Turns Used: 17
  • Cost: $0.37
  • Session ID: 771a68e0-7944-43fd-ba02-1ce093ffbba8

📁 Detailed Logs:
Execution logs generated:

  • Conversation: 17 messages
  • Session: 771a68e0-7944-43fd-ba02-1ce093ffbba8
  • Raw Output: 68,571 characters

Log files stored at:

  • conversation: /tmp/claude-logs/issue-222-2025-11-06T15-47-04-284Z-conversation.json
  • output: /tmp/claude-logs/issue-222-2025-11-06T15-47-04-284Z-output.txt
💬 Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: Perfect! I've successfully implemented all the changes for issue #222:

## Summary

Modified `src/jobs/processPullRequestCommentJob.js` to:

1. **Added reprocessing guard footer to completion comments...


Powered by Claude Code v1.0.0


This PR was created automatically by Claude Code after processing issue #222.

…ents after

Implemented by Claude Code using claude-sonnet-4-5-20250929 model.

Implementation completed successfully.
@propr-dev propr-dev Bot added the gitfix label Nov 6, 2025
@integry

integry commented Nov 6, 2025

Copy link
Copy Markdown
Owner

Adding "_Processing comment" to completion comments is wrong, the reprocessing guard should check the IDs in the completion comment.

@propr-dev

propr-dev Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor Author

🔄 Starting work on follow-up changes requested by @integry

I'll analyze the 1 request and implement the necessary changes.


Processing comment ID: 3499452481✓

… summary of the changes:

Perfect! The implementation is now correct. Let me create a summary of the changes:

## Summary

Fixed the issue where "_Processing comment ID..." was incorrectly being added to completion and error comments. The reprocessing guard now correctly checks for comment IDs only in the "starting work" comment.

### Changes made to `/home/node/workspace/src/jobs/processPullRequestCommentJob.js`:

1. **Line 536**: Removed `_Processing comment ID...` from the completion comment (when changes are applied)
2. **Line 584**: Removed `_Processing comment ID...` from the no-changes completion comment
3. **Line 700**: Removed `Comment ID...` from the error comment

The reprocessing guard at lines 114-136 checks bot comments for the pattern `${String(comment.id)}✓`, which now only appears in the "starting work" comment (line 222). This is the correct behavior - the guard checks the IDs in bot comments to prevent reprocessing, and the "starting work" comment serves as the marker for processed comments.

Key changes:
1. **Line 536**: Removed `_Processing comment ID...` from the completion comment (when changes are applied)
2. **Line 584**: Removed `_Processing comment ID...` from the no-changes completion comment
3. **Line 700**: Removed `Comment ID...` from the error comment

PR: #223
Comment by: @integry (ID: 3499452481)
Model: claude-sonnet-4-5-20250929
@propr-dev

propr-dev Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit e564ec9

Summary of Changes

Perfect! The implementation is now correct. Let me create a summary of the changes:

Summary

Fixed the issue where "_Processing comment ID..." was incorrectly being added to completion and error comments. The reprocessing guard now correctly checks for comment IDs only in the "starting work" comment.

Changes made to /home/node/workspace/src/jobs/processPullRequestCommentJob.js:

  1. Line 536: Removed _Processing comment ID... from the completion comment (when changes are applied)
  2. Line 584: Removed _Processing comment ID... from the no-changes completion comment
  3. Line 700: Removed Comment ID... from the error comment

The reprocessing guard at lines 114-136 checks bot comments for the pattern ${String(comment.id)}✓, which now only appears in the "starting work" comment (line 222). This is the correct behavior - the guard checks the IDs in bot comments to prevent reprocessing, and the "starting work" comment serves as the marker for processed comments.

Key changes:

  1. Line 536: Removed _Processing comment ID... from the completion comment (when changes are applied)
  2. Line 584: Removed _Processing comment ID... from the no-changes completion comment
  3. Line 700: Removed Comment ID... from the error comment

PR: #223
Comment by: @integry (ID: 3499452481)
Model: claude-sonnet-4-5-20250929


🤖 Implemented by Claude Code

  • Requested by: @integry
  • Model: claude-sonnet-4-5-20250929
  • Turns: 37
  • Execution time: 67s
  • Cost: $0.42

@integry

integry commented Nov 6, 2025

Copy link
Copy Markdown
Owner

But reprocessing guard will then not be triggered by the completion comment as the pattern ${String(comment.id)}✓ is not there in the completion comment. So it seems like the processing will get into the infinite loop now.

@propr-dev

propr-dev Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor Author

🔄 Starting work on follow-up changes requested by @integry

I'll analyze the 1 request and implement the necessary changes.


Processing comment ID: 3499491390✓

…on comments (both success and no-changes cases) always include the comment IDs with checkmarks. The reprocessing guard at lines 114-136 will now correctly detect processed comments even after the "starting work" comment is deleted.

Done. The infinite loop issue is fixed by ensuring completion comments (both success and no-changes cases) always include the comment IDs with checkmarks. The reprocessing guard at lines 114-136 will now correctly detect processed comments even after the "starting work" comment is deleted.

PR: #223
Comment by: @integry (ID: 3499491390)
Model: claude-sonnet-4-5-20250929
@propr-dev

propr-dev Bot commented Nov 6, 2025

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 34711cd

Summary of Changes

Done. The infinite loop issue is fixed by ensuring completion comments (both success and no-changes cases) always include the comment IDs with checkmarks. The reprocessing guard at lines 114-136 will now correctly detect processed comments even after the "starting work" comment is deleted.

PR: #223
Comment by: @integry (ID: 3499491390)
Model: claude-sonnet-4-5-20250929


🤖 Implemented by Claude Code

  • Requested by: @integry
  • Model: claude-sonnet-4-5-20250929
  • Turns: 9
  • Execution time: 34s
  • Cost: $0.34

The success and no-changes paths already delete the 'starting work' comment
after posting completion comments. This commit adds the same deletion logic
to the error path to ensure the 'starting work' comment is cleaned up even
when processing fails.

With this change, all three paths (success, no-changes, error) now:
1. Post their respective completion/error comment
2. Delete the 'starting work' comment after 3 seconds

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor: Clean up 'starting work' comments after PR follow-up processing

3 participants