fix(worker): advance parent when the last non-terminal child is deleted
DeleteTask never re-evaluated a WaitingForChildren parent, so deleting the last non-terminal child left it stuck (the BlockedByTaskId SET NULL FK only repairs the blocked chain, not parent status). Expose TaskStateService.TryAdvanceParentAsync on the interface and call it from ExternalMcpService.DeleteTask after a child delete.
This commit is contained in:
@@ -24,5 +24,10 @@ public interface ITaskStateService
|
||||
Task<TransitionResult> BlockOnAsync(string taskId, string predecessorTaskId, CancellationToken ct);
|
||||
Task<TransitionResult> UnblockAsync(string taskId, CancellationToken ct);
|
||||
|
||||
// Surfaces a WaitingForChildren parent for review once all its children are terminal.
|
||||
// Best-effort (swallows and logs failures) — safe to call after any child mutation,
|
||||
// e.g. deleting the last non-terminal child (no terminal transition fires for a delete).
|
||||
Task TryAdvanceParentAsync(string parentId);
|
||||
|
||||
Task<int> RecoverStaleRunningAsync(string reason, CancellationToken ct);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user