Selaa lähdekoodia

fix: resolve loop prevention and issue closing bugs #19

- Fixed loop prevention filter to allow Claude to work on issues it created and assigned to itself
- Updated issue closing guideline to allow closing when appropriate (user requests or work complete)
- Prevents infinite loops by only skipping when pusher is claude AND assignee is NOT claude

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

Co-Authored-By: Claude <noreply@anthropic.com>
Claude 9 kuukautta sitten
vanhempi
sitoutus
52485d0b02
2 muutettua tiedostoa jossa 9 lisäystä ja 5 poistoa
  1. 5 2
      CLAUDE.md
  2. 4 3
      scripts/handle-issue-ts.sh

+ 5 - 2
CLAUDE.md

@@ -398,7 +398,10 @@ You always have to push the changes into the git reposiroty. Before pushing chan
 ## Issue handling
  - always update the issue which you works on
  - always add label to the issue if no label added
- - always write comment with the current status of the work 
+ - always write comment with the current status of the work
  - when you create commit message, mention the issue if exists
- - never close the issue 
+ - close the issue only when:
+   - the user explicitly requests it, OR
+   - all work is completed and no further user interaction is needed
+ - never close an issue if you (Claude) need to ask the user for more information or if work is incomplete 
 

+ 4 - 3
scripts/handle-issue-ts.sh

@@ -31,9 +31,10 @@ ISSUE_ACTION="$7"
 COMMENT_BODY="$8"
 ASSIGNEE="$9"
 
-# Exit if pusher is claude (avoid loops)
-if [ "$PUSHER" = "claude" ]; then
-    echo "Pusher is claude, skipping automation to avoid loops"
+# Exit 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" ]; then
+    echo "Pusher is claude and issue not assigned to claude, skipping automation to avoid loops"
     exit 0
 fi