fix(worker): survive a worker restart when cancelling a mid-merge unit-merge parent

CancelAsync only checked PlanningMergeOrchestrator's in-memory HasActiveMerge, which is
empty after a restart. IActiveMergeState gains an async fallback that checks on-disk
(GitService.IsMidMergeAsync) for a WaitingForReview parent with children, so the guard
still blocks cancel until the merge is continued or aborted.
This commit is contained in:
Mika Kuns
2026-08-28 14:17:38 +02:00
committed by mika kuns
parent bbdb022327
commit 1affb39716
6 changed files with 63 additions and 1 deletions
@@ -7,4 +7,9 @@ namespace ClaudeDo.Worker.Planning;
public interface IActiveMergeState
{
bool HasActiveMerge(string taskId);
// In-memory state above is empty after a worker restart. This falls back to an on-disk
// check (repo mid-merge) for the one case that matters: a unit-merge parent paused on a
// conflict when the process died mid-drain.
Task<bool> HasActiveMergeAsync(string taskId, CancellationToken ct);
}