diff --git a/apps/server/src/orchestration-v2/Orchestrator.ts b/apps/server/src/orchestration-v2/Orchestrator.ts index ada7bba8234aa..6a908a5cf570c 100644 --- a/apps/server/src/orchestration-v2/Orchestrator.ts +++ b/apps/server/src/orchestration-v2/Orchestrator.ts @@ -13398,7 +13398,7 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio stored.event.payload.status === "rolled_back"), ), Stream.runForEach(handleRunUpdate), - Effect.forkDetach, + Effect.forkScoped, ); // A child whose run ends while its background tasks or its own subagents still run has no @@ -13440,7 +13440,7 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio ), ), ), - Effect.forkDetach, + Effect.forkScoped, ); const recoverDelegatedTasks = Effect.gen(function* () {