From a3f0f7f6f35d4f3e448603b9b9fed691abb299df Mon Sep 17 00:00:00 2001 From: openhands Date: Sat, 14 Mar 2026 12:01:36 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20stuck=20PR=20issue=20extraction=20?= =?UTF-8?q?=E2=80=94=20check=20title,=20body=20(Closes=20#N),=20log=20skip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PRs #684 and #710 had no issue number in branch name or title. Now also checks PR body for 'Closes #NNN'. If still no issue found, logs a skip (dev-agent requires an issue number to work). --- dev/dev-poll.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/dev/dev-poll.sh b/dev/dev-poll.sh index edd38e0..c7f701f 100755 --- a/dev/dev-poll.sh +++ b/dev/dev-poll.sh @@ -198,13 +198,20 @@ for i in $(seq 0 $(($(echo "$OPEN_PRS" | jq 'length') - 1))); do PR_BRANCH=$(echo "$OPEN_PRS" | jq -r ".[$i].head.ref") PR_SHA=$(echo "$OPEN_PRS" | jq -r ".[$i].head.sha") - # Extract issue number from branch name (fix/issue-NNN) or PR title (#NNN) + # Extract issue number from branch name (fix/issue-NNN), PR title (#NNN), or PR body (Closes #NNN) PR_TITLE=$(echo "$OPEN_PRS" | jq -r ".[$i].title") + PR_BODY=$(echo "$OPEN_PRS" | jq -r ".[$i].body // \"\"") STUCK_ISSUE=$(echo "$PR_BRANCH" | grep -oP '(?<=fix/issue-)\d+' || true) if [ -z "$STUCK_ISSUE" ]; then STUCK_ISSUE=$(echo "$PR_TITLE" | grep -oP '#\K\d+' | tail -1 || true) fi - [ -z "$STUCK_ISSUE" ] && continue + if [ -z "$STUCK_ISSUE" ]; then + STUCK_ISSUE=$(echo "$PR_BODY" | grep -oiP '(?:closes|fixes|resolves)\s*#\K\d+' | head -1 || true) + fi + if [ -z "$STUCK_ISSUE" ]; then + log "PR #${PR_NUM} has no issue ref — cannot spawn dev-agent, skipping" + continue + fi CI_STATE=$(curl -sf -H "Authorization: token ${CODEBERG_TOKEN}" \ "${API}/commits/${PR_SHA}/status" | jq -r '.state // "unknown"') || true