fix(runner): sync active Monaco workspace edits into parallel execution worktrees

This commit is contained in:
2026-06-03 14:44:57 -07:00
parent 35fc8a8b38
commit 41143fc1fd
2 changed files with 32 additions and 0 deletions

View File

@@ -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;
}