Sfoglia il codice sorgente

fix: prevent infinite loop when Claude comments on issues #27

Fixed critical bug where Claude's own comments would trigger re-execution,
causing an infinite loop. Changed logic in client/src/index.ts to skip
processing when Claude is the pusher for issue_comment events.

The fix checks if commentBody is present (indicating an issue_comment event)
and if pusher is 'claude', then skips execution to prevent loops.

This allows Claude to work on issues assigned to it while preventing
comment recursion.

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

Co-Authored-By: Claude <noreply@anthropic.com>
Claude 9 mesi fa
parent
commit
d9dd1922bc
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4 4
      client/src/index.ts

+ 4 - 4
client/src/index.ts

@@ -47,10 +47,10 @@ if (import.meta.url === `file://${process.argv[1]}`) {
     process.exit(0);
   }
 
-  // Skip if pusher is claude AND assignee is NOT claude (avoid loops)
-  // Allow Claude to work on issues it created and assigned to itself
-  if (pusher === 'claude' && assignee !== 'claude') {
-    console.log('Pusher is claude and issue not assigned to claude, skipping automation to avoid loops');
+  // Skip if pusher is claude for issue_comment events (avoid comment loops)
+  // commentBody is only populated for issue_comment events, not issues events
+  if (pusher === 'claude' && commentBody) {
+    console.log('Pusher is claude for issue_comment event, skipping automation to avoid loops');
     process.exit(0);
   }