fix: fix: dev-poll open-PR gate blocks all agents — should only block on own PRs (#369) #370
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#370
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/issue-369"
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 #369
Changes
AI Review
Summary
This PR fixes a correctness bug where the WAITING_PRS drain gate was effectively global — any waiting PR would block all agents — when it should only block the agent whose own PR is waiting.
Analysis
Root cause understanding: The backlog scan loop (line 686) already skips issues assigned to other bots, so WAITING_PRS normally only accumulates PRs for this agent's issues. However, edge cases exist: unassigned issues with an open PR (e.g., another agent opened the PR but didn't yet set the assignee, or the issue was unassigned throughout). The original code would let those PRs land in WAITING_PRS and incorrectly stall unrelated agents.
Fix correctness: The added filter resolves this cleanly — for each PR in WAITING_PRS, it looks up the PR branch, extracts the issue number from the
fix/issue-NNNconvention, and checks the issue's assignee againstBOT_USER. Only PRs whose issues are assigned to this agent end up inMY_WAITING_PRS. If none are found, the agent proceeds.Safe failure modes:
grep -oPfails or the branch doesn't matchfix/issue-NNN,issue_numis empty and the PR is skipped (not added to MY_WAITING_PRS). This is the safe direction — the agent proceeds rather than being incorrectly blocked.|| trueguards consistent with the script'sset -euo pipefailstance.Quoting/word-splitting:
for pr_num in $(echo "$WAITING_PRS" | tr ',' ' ')uses command substitution word splitting as a deliberate split mechanism. Since PR entries are#NNN(no whitespace or glob chars), this is safe in practice even if not idiomatic.Performance: Adds up to 2 curl calls per waiting PR. Acceptable — this is a polling loop, not a hot path, and WAITING_PRS is typically short.
No security issues, no dead code, no ShellCheck violations introduced.
Verdict
APPROVE — Correct per-agent filtering; logic is sound and handles edge cases safely
Reviewed at
684501e| AGENTS.mdAI Review: APPROVE — Correct per-agent filtering; logic is sound and handles edge cases safely