Skip to content

feat: session fork for alternative fix paths #71

@dougss

Description

@dougss

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

  1. Create src/core/session-fork.ts:
    • forkSession(repoPath, snapshotRef) — create parallel worktree from snapshot
    • mergeBestResult(forks[]) — pick the fork that passes validation
  2. On REQUEST_CHANGES, fork: one path with review feedback, one with rephrased prompt
  3. Run both in parallel (respects max_parallel_delegate)
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priorityenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions