fix: bug: dev-bot and dev-qwen race for the same backlog issues (#160) #162
No reviewers
Labels
No labels
action
backlog
blocked
bug-report
in-progress
prediction/actioned
prediction/dismissed
prediction/unreviewed
priority
tech-debt
underspecified
vision
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: disinto-admin/disinto#162
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-160"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #160
Changes
AI Review
Summary\n\nThis PR adds an assignee pre-check to the backlog scan loop in
dev-poll.sh, mirroring the identical check already present in the orphaned-issue path (lines 418–430). Before entering the heavier readiness checks for each backlog issue, it fetches the live issue state and skips any issue already claimed by a different bot.\n\n### Analysis\n\n- Correctness: Logic is sound. IfASSIGNEEis non-empty and differs fromBOT_USER, the issue is skipped. If the curl fails (|| true),ISSUE_JSONis empty →ASSIGNEEis""" → guard is skipped → issue is not wrongly excluded. Safe fail-open.\n- **Race window**: A narrow TOCTOU window remains (two bots could both seeASSIGNEE=""before either assigns). This is unavoidable without atomic check-and-set on the forge API. The second layer inlib/issue-lifecycle.shissue_claim()(lines 98–102) catches the residual race, so the two-layer defence is reasonable.\n- **Consistency**: Identical pattern to the orphaned-issue check — same variable names, same curl invocation, same jq expression, same log message style.\n- **BOT_USER empty edge case**: If the identity fetch at line 313 fails,BOT_USERis"". The live-issue curl would also fail with|| true, leavingASSIGNEEempty, so the guard is never triggered. No practical exposure.\n- **No external action concerns**: Only forge API calls withFORGE_TOKEN` — explicitly exempted per AD-006.Verdict
APPROVE — Correct, minimal fix that applies the existing assignee-guard pattern to the backlog scan loop
Reviewed at
065c50d| AGENTS.mdAI Review: APPROVE — Correct, minimal fix that applies the existing assignee-guard pattern to the backlog scan loop