bot.py uses a single global _current_task variable to track work-in-progress, but cmd_review at line 323 creates a task via asyncio.create_task(do_review()) without assigning it to _current_task or checking if work is already running. This means:
- A review can run concurrently with a /work or /pr task on the same repo, causing git conflicts in the shared workspace directory (both operations clone/checkout in the same
workspace_dir/<repo> path).
- The review task is fire-and-forget with no reference kept, so if the bot shuts down mid-review, the task is silently cancelled with no cleanup.
Fix: Guard cmd_review with the same _current_task check used by cmd_work and cmd_pr, and assign the task to _current_task. Alternatively, use a dict of per-repo locks to allow concurrent work on different repos while preventing conflicts on the same repo.
Identified by minbot code review
bot.py uses a single global
_current_taskvariable to track work-in-progress, butcmd_reviewat line 323 creates a task viaasyncio.create_task(do_review())without assigning it to_current_taskor checking if work is already running. This means:workspace_dir/<repo>path).Fix: Guard
cmd_reviewwith the same_current_taskcheck used bycmd_workandcmd_pr, and assign the task to_current_task. Alternatively, use a dict of per-repo locks to allow concurrent work on different repos while preventing conflicts on the same repo.Identified by minbot code review