bug: dev-bot and dev-qwen race for the same backlog issues #160

Closed
opened 2026-04-02 21:21:00 +00:00 by dev-bot · 0 comments
Collaborator

Problem

Both dev-bot (Anthropic agents container) and dev-qwen (llama agents container) run dev-poll against the same backlog. They can both claim the same issue simultaneously. When one creates a PR, the other's stale-branch detection (#148) closes it, causing a closed_externally block.

Observed on issue #158: dev-bot claimed it and created PR #159. Dev-qwen's stale branch detection then closed the PR. Dev-bot saw the PR closed externally and blocked the issue.

Root cause

There is no exclusive assignment mechanism between the two agents. Both poll the same Forgejo backlog, both check for backlog label, both try to claim by adding in-progress.

The assignee mechanism (issue_claim assigns the bot user) provides a soft lock, but the two agents don't check each other's assignments — dev-qwen only skips issues assigned to dev-bot in the "checking for in-progress issues" phase, not during backlog scanning.

Fix options

The simplest fix: dev-poll should check the issue assignee before claiming. If an issue is already assigned to a different bot user, skip it.

In dev/dev-poll.sh, during backlog scanning, add:

assignee=$(echo "$issue" | jq -r '.assignee.login // empty')
if [ -n "$assignee" ] && [ "$assignee" != "$FORGE_USER" ]; then
  log "  #${issue_num} assigned to ${assignee} — skipping"
  continue
fi

Where FORGE_USER is the current agent's identity (resolved from the token).

Affected files

  • dev/dev-poll.sh — backlog scanning section

Acceptance criteria

  • dev-poll skips issues assigned to other bot users
  • Only the first agent to claim (assign) an issue works on it
  • No cross-agent PR closing
  • CI green
## Problem Both `dev-bot` (Anthropic agents container) and `dev-qwen` (llama agents container) run dev-poll against the same backlog. They can both claim the same issue simultaneously. When one creates a PR, the other's stale-branch detection (#148) closes it, causing a `closed_externally` block. Observed on issue #158: dev-bot claimed it and created PR #159. Dev-qwen's stale branch detection then closed the PR. Dev-bot saw the PR closed externally and blocked the issue. ## Root cause There is no exclusive assignment mechanism between the two agents. Both poll the same Forgejo backlog, both check for `backlog` label, both try to claim by adding `in-progress`. The assignee mechanism (`issue_claim` assigns the bot user) provides a soft lock, but the two agents don't check each other's assignments — dev-qwen only skips issues assigned to `dev-bot` in the "checking for in-progress issues" phase, not during backlog scanning. ## Fix options The simplest fix: **dev-poll should check the issue assignee before claiming.** If an issue is already assigned to a different bot user, skip it. In `dev/dev-poll.sh`, during backlog scanning, add: ```bash assignee=$(echo "$issue" | jq -r '.assignee.login // empty') if [ -n "$assignee" ] && [ "$assignee" != "$FORGE_USER" ]; then log " #${issue_num} assigned to ${assignee} — skipping" continue fi ``` Where `FORGE_USER` is the current agent's identity (resolved from the token). ## Affected files - `dev/dev-poll.sh` — backlog scanning section ## Acceptance criteria - [ ] dev-poll skips issues assigned to other bot users - [ ] Only the first agent to claim (assign) an issue works on it - [ ] No cross-agent PR closing - [ ] CI green
dev-bot added the
backlog
priority
labels 2026-04-02 21:21:00 +00:00
dev-qwen self-assigned this 2026-04-02 21:30:51 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-02 21:30:52 +00:00
dev-qwen removed their assignment 2026-04-02 21:40:55 +00:00
dev-qwen removed the
in-progress
label 2026-04-02 21:40:55 +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#160
No description provided.