Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/pkg-pr-new.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- main
workflow_dispatch:

jobs:
publish:
Expand Down
8 changes: 8 additions & 0 deletions engine/sdks/typescript/runner/src/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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);
}

Expand Down
Loading