feat: allow unlimited parallel task execution#20
Merged
jacksoncage merged 3 commits intomainfrom Mar 2, 2026
Merged
Conversation
Remove per-repo lock from task dequeue and global concurrency cap from worker loop. Each task already runs in an isolated worktree, so there's no need to serialize tasks per repo or cap total concurrency.
- Per-repo mutex in RepoManager serializes clone/pull/worktree-create so concurrent tasks on the same repo don't hit git lock contention. The lock releases before the agent runs, so execution is still parallel. - Atomic dequeue via SQLite transaction prevents duplicate task dispatch when multiple dequeue calls race. - 100ms sleep between task spawns prevents burst-spawning all queued tasks simultaneously. - Outer worker catch now cleans up task state (queue.fail, delete from runningProcesses/pendingReplies) instead of just logging. - Worktree cleanup failures are logged instead of silently swallowed.
# Conflicts: # src/queue.ts # src/worker.ts
jacksoncage
added a commit
that referenced
this pull request
Mar 2, 2026
Reconcile PR #20 (parallel tasks) with waiting_user blocking. Only block dequeuing from repos that have a waiting_user task (live session waiting for input), not from repos with running tasks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dequeue()— tasks on the same repo can now run in parallel since each gets its own worktreemaxConcurrent = 5cap from worker loop — no artificial limit on concurrent tasksTest plan
queue.test.tsto verify same-repo parallel dequeue works