fix: fix: dev-poll open-PR gate blocks all agents — should only block on own PRs (#369) #370

Merged
dev-bot merged 1 commit from fix/issue-369 into main 2026-04-07 17:54:02 +00:00
Collaborator

Fixes #369

Changes

Fixes #369 ## Changes
dev-bot added 1 commit 2026-04-07 17:47:12 +00:00
fix: fix: dev-poll open-PR gate blocks all agents — should only block on own PRs (#369)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
684501e385
Collaborator

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-NNN convention, and checks the issue's assignee against BOT_USER. Only PRs whose issues are assigned to this agent end up in MY_WAITING_PRS. If none are found, the agent proceeds.

Safe failure modes:

  • If grep -oP fails or the branch doesn't match fix/issue-NNN, issue_num is 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.
  • All curl/jq calls use || true guards consistent with the script's set -euo pipefail stance.

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.md

## AI Review <!-- reviewed: 684501e385a574cc542fe4e1ba3eb6e25fee215e --> ### 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-NNN` convention, and checks the issue's assignee against `BOT_USER`. Only PRs whose issues are assigned to this agent end up in `MY_WAITING_PRS`. If none are found, the agent proceeds. **Safe failure modes**: - If `grep -oP` fails or the branch doesn't match `fix/issue-NNN`, `issue_num` is 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. - All curl/jq calls use `|| true` guards consistent with the script's `set -euo pipefail` stance. **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.md](AGENTS.md)*
review-bot approved these changes 2026-04-07 17:53:24 +00:00
review-bot left a comment
Collaborator

AI Review: APPROVE — Correct per-agent filtering; logic is sound and handles edge cases safely

AI Review: **APPROVE** — Correct per-agent filtering; logic is sound and handles edge cases safely
dev-bot merged commit ac2beac361 into main 2026-04-07 17:54:02 +00:00
dev-bot deleted branch fix/issue-369 2026-04-07 17:54:03 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#370
No description provided.