From f6e1229413513a6460fbc64b8d6a5c7285c3cb04 Mon Sep 17 00:00:00 2001 From: maria-rcks <254055478+maria-rcks@users.noreply.github.com> Date: Fri, 30 Oct 2026 21:33:15 +0000 Subject: [PATCH] fix(server): stop event subscribers before closing the database --- apps/server/src/orchestration-v2/Orchestrator.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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* () {