fix(runner): sync active Monaco workspace edits into parallel execution worktrees
This commit is contained in:
@@ -113,6 +113,26 @@ function ensureWorkspace(repo?: string, sessionId?: string): string {
|
||||
}
|
||||
}
|
||||
|
||||
// 5. Sync active workspace edits from mainRepoDir (containing Monaco edits) to taskWorktreePath
|
||||
if (taskWorktreePath !== mainRepoDir) {
|
||||
try {
|
||||
console.log(
|
||||
`[worktree] Syncing active workspace edits from ${mainRepoDir} to ${taskWorktreePath}...`,
|
||||
);
|
||||
// Use rsync to copy active files while preserving structure and deleting files deleted in mainRepoDir
|
||||
// Exclude node_modules, .git, .next, .vibncode/settings.json, etc.
|
||||
execSync(
|
||||
`rsync -ar --delete --exclude="node_modules" --exclude=".git" --exclude=".next" --exclude=".vibncode/settings.json" "${mainRepoDir}/" "${taskWorktreePath}/"`,
|
||||
{ stdio: "pipe" },
|
||||
);
|
||||
} catch (syncErr: any) {
|
||||
console.warn(
|
||||
"[worktree] rsync failed, falling back to cp:",
|
||||
syncErr.message || syncErr,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return taskWorktreePath;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user