The idle-worktree sweep (cleanupOrphans) and cap-enforcement sweep only guarded isWorktreeResumeReserved (CLI resume sessions), not in-process active sessions. scanIdleWorktrees treats a worktree as active only while a non-done task points at it, but the executor transiently moves tasks to done or nulls the worktree field mid-run — so a checkout backing a live executor/merger/step/workflow session could be removed before the work finished. Add the activeSessionRegistry.isPathActive guard to both loops, mirroring reapUnregisteredOrphans (FN-4811/FN-5065). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
338 B
338 B
@runfusion/fusion
| @runfusion/fusion |
|---|
| patch |
Stop self-healing from removing worktrees that are still in use. The idle-worktree and cap-enforcement sweeps now skip any worktree bound to a live executor/merger/step/workflow session, so a checkout is no longer reaped while its task transiently sits in done or loses its worktree linkage mid-run.