Repository navigation
fix: per-task worktree slot ownership (no shared pool worktrees) - #96
Merged
Merged
Conversation
Slot choice read other tasks' worktree paths and fell back to slot 0 when every index looked taken, so two live tasks could check out the same directory. Persist one owner per slot, claim it in a write transaction, and refuse checkout when another live task still owns it. Co-authored-by: rimusz <rimusz@users.noreply.github.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.
Root cause
pick_pool_slotchose a slot by scanning other tasks' worktree paths. Two dispatches in the same tick both took slot 0. Reuse did not check the owner. macOS has no busy-tree check.Fix
pool_slotsrows are keyed by task id and claimed in one write transaction. Checkout is refused when another live task owns the directory. When no slot is free the task is queued. Stale slots are cleaned up.Tests
992 pass locally on the agent.
Limits
Force-cancel frees the slot when the task is marked failed. There is no macOS process-cwd check.