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.
16 lines
778 B
C#
16 lines
778 B
C#
namespace ClaudeDo.Worker.Planning;
|
|
|
|
// Lets TaskStateService guard CancelAsync against an in-progress unit merge without a
|
|
// hard constructor cycle back to PlanningMergeOrchestrator (which itself depends on
|
|
// ITaskStateService) — TaskStateService takes a Func<IActiveMergeState> instead, resolved
|
|
// lazily so both singletons can finish constructing before either calls into the other.
|
|
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);
|
|
}
|