I can see the problem - the agent-manager received an issue_comment event for issue #17 in the shopcall repository, but it was skipped with the message: "Skipping duplicate job for issue-17-created-claude (processed 185s ago)".
I'll investigate the duplicate detection logic in the JobQueue system to understand why legitimate callbacks are being incorrectly filtered as duplicates. This appears to be an issue with how we generate job IDs or track processed jobs.
@fszontagh I'm starting work on this issue now!
I can see the problem - the agent-manager received an `issue_comment` event for issue #17 in the shopcall repository, but it was skipped with the message: "Skipping duplicate job for issue-17-created-claude (processed 185s ago)".
I'll investigate the duplicate detection logic in the JobQueue system to understand why legitimate callbacks are being incorrectly filtered as duplicates. This appears to be an issue with how we generate job IDs or track processed jobs.
The problem is that this key doesn't include the event type. So when:
An issues event comes in with action: "assigned" for issue #17 → Key: issue-17-assigned-claude
Later, an issue_comment event comes in with action: "created" for the same issue #17 → Key: issue-17-created-claude
Even though these are different event types (issue vs comment), if there was a previous issue event with action: "created", then any issue_comment event will be incorrectly treated as a duplicate.
The Fix
I need to change line 93 to include the event type in the key:
This will ensure issues and issue_comment events are tracked separately, even for the same issue number.
Let me implement this fix now.
## Root Cause Identified
I've found the bug in `/src/jobQueue.js` at line 93. The duplicate detection logic creates a key like this:
```javascript
const key = `issue-${issueNumber}-${action}-${assignee}`;
```
The problem is that this key **doesn't include the event type**. So when:
1. An `issues` event comes in with `action: "assigned"` for issue #17 → Key: `issue-17-assigned-claude`
2. Later, an `issue_comment` event comes in with `action: "created"` for the same issue #17 → Key: `issue-17-created-claude`
Even though these are different event types (issue vs comment), if there was a previous issue event with `action: "created"`, then any `issue_comment` event will be incorrectly treated as a duplicate.
## The Fix
I need to change line 93 to include the event type in the key:
```javascript
const key = `${eventType}-issue-${issueNumber}-${action}-${assignee}`;
```
This will ensure `issues` and `issue_comment` events are tracked separately, even for the same issue number.
Let me implement this fix now.
Changed to: ${eventType}-issue-${issueNumber}-${action}-${assignee}
Impact:
issues events and issue_comment events are now tracked separately
Comments on issues will no longer be incorrectly skipped as duplicates
Each event type maintains its own duplicate detection tracking
Next Steps:
The agent-manager service needs to be restarted on the production server for the fix to take effect. You can restart it with:
sudo /bin/systemctl restart agent-manager
After restarting, the issue with callbacks being ignored should be resolved. The system will now correctly process both issue events and comment events, even when they occur on the same issue within a 5-minute window.
## ✅ Fix Implemented and Pushed
I've successfully fixed the bug and pushed the changes to the repository.
**Commit:** ec07ba3
**What Changed:**
- Modified `/src/jobQueue.js` line 94 to include the event type in the duplicate detection key
- Changed from: `issue-${issueNumber}-${action}-${assignee}`
- Changed to: `${eventType}-issue-${issueNumber}-${action}-${assignee}`
**Impact:**
- `issues` events and `issue_comment` events are now tracked separately
- Comments on issues will no longer be incorrectly skipped as duplicates
- Each event type maintains its own duplicate detection tracking
**Next Steps:**
The agent-manager service needs to be restarted on the production server for the fix to take effect. You can restart it with:
```bash
sudo /bin/systemctl restart agent-manager
```
After restarting, the issue with callbacks being ignored should be resolved. The system will now correctly process both issue events and comment events, even when they occur on the same issue within a 5-minute window.
This is the issue where the bug happens: fszontagh/shopcall#17
This is the agent-manager log:
@fszontagh I'm starting work on this issue now!
I can see the problem - the agent-manager received an
issue_commentevent for issue #17 in the shopcall repository, but it was skipped with the message: "Skipping duplicate job for issue-17-created-claude (processed 185s ago)".I'll investigate the duplicate detection logic in the JobQueue system to understand why legitimate callbacks are being incorrectly filtered as duplicates. This appears to be an issue with how we generate job IDs or track processed jobs.
Root Cause Identified
I've found the bug in
/src/jobQueue.jsat line 93. The duplicate detection logic creates a key like this:The problem is that this key doesn't include the event type. So when:
issuesevent comes in withaction: "assigned"for issue #17 → Key:issue-17-assigned-claudeissue_commentevent comes in withaction: "created"for the same issue #17 → Key:issue-17-created-claudeEven though these are different event types (issue vs comment), if there was a previous issue event with
action: "created", then anyissue_commentevent will be incorrectly treated as a duplicate.The Fix
I need to change line 93 to include the event type in the key:
This will ensure
issuesandissue_commentevents are tracked separately, even for the same issue number.Let me implement this fix now.
✅ Fix Implemented and Pushed
I've successfully fixed the bug and pushed the changes to the repository.
Commit:
ec07ba3What Changed:
/src/jobQueue.jsline 94 to include the event type in the duplicate detection keyissue-${issueNumber}-${action}-${assignee}${eventType}-issue-${issueNumber}-${action}-${assignee}Impact:
issuesevents andissue_commentevents are now tracked separatelyNext Steps: The agent-manager service needs to be restarted on the production server for the fix to take effect. You can restart it with:
After restarting, the issue with callbacks being ignored should be resolved. The system will now correctly process both issue events and comment events, even when they occur on the same issue within a 5-minute window.