diff --git a/packages/core/src/runtime/supervise.ts b/packages/core/src/runtime/supervise.ts index a97ab37..ed7783a 100644 --- a/packages/core/src/runtime/supervise.ts +++ b/packages/core/src/runtime/supervise.ts @@ -54,7 +54,8 @@ export class Supervisor { Turn.activeFacet.onStop(() => { const exitReason = this.supervisee?.exitReason; if (!exitReason) { - throw new Error("Expected supervisee to have terminated"); + // Supervisor shutdown. Supervisee will exit soon. + return; } if (exitReason.ok && (this.config.restartPolicy === SupervisorRestartPolicy.ON_ERROR_ONLY)) { this.state.value = 'complete';