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:
@@ -357,6 +357,8 @@ public sealed class ExternalMcpService
|
||||
throw new InvalidOperationException("Cannot delete a running task. Cancel it first.");
|
||||
|
||||
await _tasks.DeleteAsync(taskId, cancellationToken);
|
||||
if (task.ParentTaskId is not null)
|
||||
await _state.TryAdvanceParentAsync(task.ParentTaskId);
|
||||
await _broadcaster.TaskUpdated(taskId);
|
||||
return new DeleteTaskResult(true, taskId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user