Skip to content

Commit be98547

Browse files
fix(server): stop both delegated completion wake cohorts
1 parent 577b32c commit be98547

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

‎apps/server/src/orchestration-v2/Orchestrator.ts‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9319,14 +9319,16 @@ const makeOrchestrator = Effect.fn("orchestrationV2.Orchestrator.layer")(functio
93199319
now,
93209320
})
93219321
: Effect.gen(function* () {
9322-
yield* disposeDelegatedCompletionCohort({
9323-
command,
9324-
events,
9325-
projection: yield* getProjectionWithPendingEvents(command.threadId, events),
9326-
parentRunId: completionCohortRunId,
9327-
disposition: "stopped",
9328-
now,
9329-
});
9322+
for (const parentRunId of new Set([completionCohortRunId, run.id])) {
9323+
yield* disposeDelegatedCompletionCohort({
9324+
command,
9325+
events,
9326+
projection: yield* getProjectionWithPendingEvents(command.threadId, events),
9327+
parentRunId,
9328+
disposition: "stopped",
9329+
now,
9330+
});
9331+
}
93309332
});
93319333

93329334
const emitEvent = emit(events, command);

0 commit comments

Comments
 (0)