fix: dev-poll pre-lock merge scan should only merge own PRs #374

Closed
opened 2026-04-07 18:19:42 +00:00 by dev-bot · 0 comments
Collaborator

Problem

dev/dev-poll.sh pre-lock merge scan merges any approved+green PR regardless of who created it. With two dev agents (dev-bot, dev-qwen), each agent merges the other's PRs. This causes:

  • "PR merged externally" confusion in the PR walk
  • Race conditions where both try to merge the same PR
  • Agents stepping on each other's pipeline

Fix

In the pre-lock merge scan, resolve the current agent identity and only merge PRs where the issue is assigned to this agent:

me=$(curl -sf -H "Authorization: token ${FORGE_TOKEN}" "${FORGE_URL}/api/v1/user" | jq -r '.login')
# ... for each mergeable PR:
pr_assignee=$(echo "$pr_json" | jq -r '.assignee.login // ""')
if [ -n "$pr_assignee" ] && [ "$pr_assignee" != "$me" ]; then
  log "PR #${pr_num} assigned to ${pr_assignee} — skipping merge"
  continue
fi

The identity resolution should happen once at the start of dev-poll (cache $me), not per-PR.

Affected files

  • dev/dev-poll.sh (pre-lock merge scan section)

Acceptance criteria

  • Dev-bot only merges PRs from issues assigned to dev-bot
  • Dev-qwen only merges PRs from issues assigned to dev-qwen
  • No "PR merged externally" from the other agent's merge
  • Both agents can have PRs in review simultaneously without interfering
## Problem dev/dev-poll.sh pre-lock merge scan merges any approved+green PR regardless of who created it. With two dev agents (dev-bot, dev-qwen), each agent merges the other's PRs. This causes: - "PR merged externally" confusion in the PR walk - Race conditions where both try to merge the same PR - Agents stepping on each other's pipeline ## Fix In the pre-lock merge scan, resolve the current agent identity and only merge PRs where the issue is assigned to this agent: me=$(curl -sf -H "Authorization: token ${FORGE_TOKEN}" "${FORGE_URL}/api/v1/user" | jq -r '.login') # ... for each mergeable PR: pr_assignee=$(echo "$pr_json" | jq -r '.assignee.login // ""') if [ -n "$pr_assignee" ] && [ "$pr_assignee" != "$me" ]; then log "PR #${pr_num} assigned to ${pr_assignee} — skipping merge" continue fi The identity resolution should happen once at the start of dev-poll (cache $me), not per-PR. ## Affected files - dev/dev-poll.sh (pre-lock merge scan section) ## Acceptance criteria - [ ] Dev-bot only merges PRs from issues assigned to dev-bot - [ ] Dev-qwen only merges PRs from issues assigned to dev-qwen - [ ] No "PR merged externally" from the other agent's merge - [ ] Both agents can have PRs in review simultaneously without interfering
dev-bot added the
backlog
priority
labels 2026-04-07 18:19:42 +00:00
disinto-admin removed the
priority
label 2026-04-07 18:19:55 +00:00
dev-qwen self-assigned this 2026-04-07 19:11:24 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-07 19:11:24 +00:00
dev-qwen removed their assignment 2026-04-07 19:18:37 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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#374
No description provided.