Summary
When REVIEW gives REQUEST_CHANGES, fork the session to try an alternative approach from the same checkpoint instead of retrying linearly. Increases success rate for complex fixes.
Current State
- Review loop retries linearly: same executor, same approach, just different error context
- No branching/forking of execution paths
- If the approach is fundamentally wrong, retries waste budget
Plan
- Create
src/core/session-fork.ts:
forkSession(repoPath, snapshotRef) — create parallel worktree from snapshot
mergeBestResult(forks[]) — pick the fork that passes validation
- On REQUEST_CHANGES, fork: one path with review feedback, one with rephrased prompt
- Run both in parallel (respects
max_parallel_delegate)
- Merge the winning fork back
Dependencies
- Requires snapshot system (#XX — git snapshot issue)
- Requires parallel delegate support
Files
src/core/session-fork.ts (NEW)
src/core/pipeline.ts
src/integrations/git/worktrees.ts
Summary
When REVIEW gives REQUEST_CHANGES, fork the session to try an alternative approach from the same checkpoint instead of retrying linearly. Increases success rate for complex fixes.
Current State
Plan
src/core/session-fork.ts:forkSession(repoPath, snapshotRef)— create parallel worktree from snapshotmergeBestResult(forks[])— pick the fork that passes validationmax_parallel_delegate)Dependencies
Files
src/core/session-fork.ts(NEW)src/core/pipeline.tssrc/integrations/git/worktrees.ts