diff --git a/.github/workflows/pkg-pr-new.yaml b/.github/workflows/pkg-pr-new.yaml index a3e38cb7e0..d25c01d957 100644 --- a/.github/workflows/pkg-pr-new.yaml +++ b/.github/workflows/pkg-pr-new.yaml @@ -3,6 +3,7 @@ on: push: branches: - main + workflow_dispatch: jobs: publish: diff --git a/engine/sdks/typescript/runner/src/mod.ts b/engine/sdks/typescript/runner/src/mod.ts index 724f8ecd49..1adf227087 100644 --- a/engine/sdks/typescript/runner/src/mod.ts +++ b/engine/sdks/typescript/runner/src/mod.ts @@ -287,6 +287,7 @@ export class Runner { const actor = this.getActor(actorId, generation); if (!actor) return; + actor.stopIntentSent = true; // Keep the actor instance in memory during sleep this.#sendActorIntent(actorId, actor.generation, "sleep"); @@ -1189,6 +1190,13 @@ export class Runner { const actorId = commandWrapper.checkpoint.actorId; const generation = commandWrapper.checkpoint.generation; + // CommandStopActor is always an engine-authorized graceful stop (sleep or + // destroy). Mark stopIntentSent so #sendActorStateUpdate sends StopCode.Ok + // instead of StopCode.Error. The #handleLost path intentionally omits this + // mark so unresponsive actors still surface as errors. + const actor = this.getActor(actorId, generation); + if (actor) actor.stopIntentSent = true; + await this.forceStopActor(actorId, generation); }