From 2979580171e6b90fff397bf63dc7baab54910f7b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 14 Apr 2026 20:15:21 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20bug:=20dev-poll.sh=20post-crash=20deadlo?= =?UTF-8?q?ck=20=E2=80=94=20self-assigned=20in-progress=20issue=20never=20?= =?UTF-8?q?recovered=20when=20no=20lock/branch/PR=20(#749)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.6 (1M context) --- dev/dev-poll.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dev/dev-poll.sh b/dev/dev-poll.sh index dc387f8..e9d085d 100755 --- a/dev/dev-poll.sh +++ b/dev/dev-poll.sh @@ -476,8 +476,19 @@ if [ "$ORPHAN_COUNT" -gt 0 ]; then BLOCKED_BY_INPROGRESS=true fi else - log "issue #${ISSUE_NUM} assigned to me — my thread is busy" - BLOCKED_BY_INPROGRESS=true + # No open PR — check if a thread is actually alive (lock file or remote branch) + LOCK_FILE="/tmp/dev-impl-summary-${PROJECT_NAME}-${ISSUE_NUM}.txt" + REMOTE_BRANCH_EXISTS=$(git ls-remote --exit-code origin "fix/issue-${ISSUE_NUM}" >/dev/null 2>&1 && echo yes || echo no) + + if [ -f "$LOCK_FILE" ] || [ "$REMOTE_BRANCH_EXISTS" = "yes" ]; then + log "issue #${ISSUE_NUM} assigned to me — my thread is busy (lock=$([ -f "$LOCK_FILE" ] && echo y || echo n) remote_branch=$REMOTE_BRANCH_EXISTS)" + BLOCKED_BY_INPROGRESS=true + else + log "issue #${ISSUE_NUM} self-assigned but orphaned (no lock, no branch, no PR) — recovering" + nohup "${SCRIPT_DIR}/dev-agent.sh" "$ISSUE_NUM" >> "$LOGFILE" 2>&1 & + log "started dev-agent PID $! for issue #${ISSUE_NUM} (post-crash recovery)" + BLOCKED_BY_INPROGRESS=true + fi fi else log "issue #${ISSUE_NUM} assigned to ${assignee} — their thread, not blocking"