fix: bug: dev-poll stale detection races with issue_claim — blocks freshly claimed issues (#471)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

Add 60-second grace period to stale in-progress detection in dev-poll.sh.
When a poller sees an in-progress issue with no assignee/PR/lock, it now
checks the timeline API for when the label was added. If <60s ago, it
skips stale detection to allow the claiming agent time to finish its
assign+label sequence.

Also documents the intentional assign-before-label ordering in
issue_claim() that minimizes the race window.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude 2026-04-09 14:45:30 +00:00
parent 9d0b7f2b07
commit 8679332756
2 changed files with 43 additions and 4 deletions

View file

@ -102,7 +102,9 @@ issue_claim() {
return 1
fi
# Assign to self (Forgejo rejects if already assigned differently)
# Assign to self BEFORE adding in-progress label (issue #471).
# This ordering ensures the assignee is set by the time other pollers
# see the in-progress label, reducing the stale-detection race window.
curl -sf -X PATCH \
-H "Authorization: token ${FORGE_TOKEN}" \
-H "Content-Type: application/json" \