From c0ac168945ebf0f59240b16945b16afa74ab8e57 Mon Sep 17 00:00:00 2001 From: abcxff <79597906+abcxff@users.noreply.github.com> Date: Thu, 30 Apr 2026 19:02:33 -0400 Subject: [PATCH 1/3] fix(engine-runner): send StopCode.Ok for engine-initiated stops --- engine/sdks/typescript/runner/src/mod.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/engine/sdks/typescript/runner/src/mod.ts b/engine/sdks/typescript/runner/src/mod.ts index 724f8ecd49..d5f0d188e6 100644 --- a/engine/sdks/typescript/runner/src/mod.ts +++ b/engine/sdks/typescript/runner/src/mod.ts @@ -1189,6 +1189,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); } From 8b25a10f8c76f50a708fb371b05f5fe667e497ab Mon Sep 17 00:00:00 2001 From: abcxff <79597906+abcxff@users.noreply.github.com> Date: Thu, 30 Apr 2026 19:23:35 -0400 Subject: [PATCH 2/3] chore: add workflow_dispatch to pkg-pr-new --- .github/workflows/pkg-pr-new.yaml | 1 + 1 file changed, 1 insertion(+) 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: From 49011521cbd31b9a30d471fe187629aa05b36cc1 Mon Sep 17 00:00:00 2001 From: abcxff <79597906+abcxff@users.noreply.github.com> Date: Fri, 1 May 2026 15:28:10 -0400 Subject: [PATCH 3/3] fix(rivetkit): set stopIntentSent = true in #handleCommandStopActor --- engine/sdks/typescript/runner/src/mod.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/sdks/typescript/runner/src/mod.ts b/engine/sdks/typescript/runner/src/mod.ts index d5f0d188e6..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");