fix(sdd): allow parallel dispatch with worktree isolation#1534
Open
xuefei-wang wants to merge 1 commit into
Open
fix(sdd): allow parallel dispatch with worktree isolation#1534xuefei-wang wants to merge 1 commit into
xuefei-wang wants to merge 1 commit into
Conversation
The blanket 'never dispatch subagents in parallel' rule was too broad. Staged-index conflicts only occur when subagents touch overlapping files or have sequential dependencies — file-independent tasks can be safely dispatched in parallel using `isolation: "worktree"`, which gives each subagent its own git worktree. Two changes: 1. Red Flag narrowed: prohibit parallel dispatch only for overlapping-file or sequentially-dependent tasks; explicitly recommend worktree isolation for file-independent tasks. 2. New 'Parallel dispatch' paragraph added alongside 'Continuous execution': guides the controller to scan for file-independent task groups and dispatch them in parallel with worktree isolation before starting.
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.
Problem
The Red Flag entry:
is too broad. Staged-index conflicts only happen when subagents share the same git worktree and touch overlapping files. File-independent tasks dispatched with
isolation: "worktree"each get their own git worktree — no index conflict is possible.As written, the rule steers controllers away from the correct high-speed pattern even when it would be perfectly safe.
Changes
1. Narrow the Red Flag (line 242)
Before:
After:
2. Add Parallel dispatch guidance (after the Continuous execution paragraph)
New paragraph:
Why this is safe
isolation: "worktree"(the Agent tool parameter in Claude Code) provisions a fresh git worktree per subagent. Each worktree has its own index and working tree — there is no shared staging area to conflict over. The only case where parallel dispatch causes problems is when two subagents write to the same files in the same worktree, which this guidance explicitly carves out.