fix: use Forgejo assignee as issue lock to prevent concurrent claims #38
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Problem
issue_claim()inlib/issue-lifecycle.shadds thein-progresslabel but never checks if another agent already claimed the issue. With multiple dev-agent containers, both can claim the same issue simultaneously.Additionally,
dev-poll.shhas recovery logic that picks upin-progressissues without a PR ("orphaned"). When two agents run, agent B sees agent A's freshly-claimed issue as orphaned and starts working on it too.Fix
Use Forgejo's issue assignee as an atomic lock.
issue_claim changes
In
lib/issue-lifecycle.sh,issue_claim()should:$FORGE_BOT_USER, derived from the token)in-progresslabel and removebacklogdev-poll recovery changes
In
dev-poll.sh, the orphaned-issue recovery (Priority 1) should check the assignee before adopting:dev-agent cleanup
issue_release()andissue_close()should clear the assignee.Affected files
lib/issue-lifecycle.sh—issue_claim(),issue_release(),issue_close()dev/dev-poll.sh— orphan recovery sectionAcceptance criteria
issue_claim()assigns to self, returns 1 if already assigned to anotherdev-agent.shchecks return code, exits cleanly if claim failsissue_release()andissue_close()clear assignee