zeitlich 0.2.24 → 0.2.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/workflow.js CHANGED
@@ -428,8 +428,9 @@ function createSubagentHandler(subagents) {
428
428
  taskQueue: config.taskQueue ?? parentTaskQueue
429
429
  };
430
430
  const childHandle = await startChild(config.workflow, childOpts);
431
- const usesOwnSandbox = sandboxCfg.source === "own" || allowsContinuation && sandboxCfg.source !== "inherit";
432
- if (usesOwnSandbox) {
431
+ const effectiveShutdown = sandboxCfg.shutdown ?? "destroy";
432
+ const shouldDeferDestroy = effectiveShutdown === "pause-until-parent-close" && (sandboxCfg.source === "own" || allowsContinuation && sandboxCfg.source !== "inherit");
433
+ if (shouldDeferDestroy) {
433
434
  pendingDestroys.set(childWorkflowId, childHandle);
434
435
  }
435
436
  await Promise.race([