feat: batch-level conflict resolution for worktree merges

Add reattemptMerge/abortMerge/completeMerge/hasMergeConflicts helpers to
worktree.ts. When a worktree merge conflicts, executeTask now defers to
batch-level resolution instead of immediately marking the task failed.

After all tasks in a batch finish, resolveConflictsSession re-attempts the
merge to recreate the conflict state, spawns an agent session with
buildConflictResolutionPrompt to resolve conflict markers and commit, then
verifies completion. This keeps parallel task slots unblocked — conflicts
are resolved sequentially at the batch boundary.
This commit is contained in:
2026-07-20 15:45:12 -04:00
parent 46da29ee22
commit c46f8f1783
4 changed files with 427 additions and 46 deletions

View File

@@ -278,7 +278,7 @@ export const DEFAULT_CONFIG: RalpiConfig = {
maxReviewRetries: 2, // 2 re-execution attempts on review rejection before giving up
reviewBlockOnFail: false, // false = commit anyway after retries exhausted
loopTimeoutMs: 0, // 0 = no limit
worktrees: "never", // worktree isolation per task
worktrees: "parallel", // worktree isolation for parallel tasks by default
},
prompts: {
projectContext: "",