@rivetkit/engine-runner 2.2.1-pr.4600.f4b52ef → 2.2.2-rc.1

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/package.json CHANGED
@@ -1,43 +1,43 @@
1
1
  {
2
- "name": "@rivetkit/engine-runner",
3
- "version": "2.2.1-pr.4600.f4b52ef",
4
- "type": "module",
5
- "files": [
6
- "dist",
7
- "src",
8
- "package.json"
9
- ],
10
- "exports": {
11
- "import": {
12
- "types": "./dist/mod.d.ts",
13
- "default": "./dist/mod.js"
14
- },
15
- "require": {
16
- "types": "./dist/mod.d.cts",
17
- "default": "./dist/mod.cjs"
18
- }
19
- },
20
- "scripts": {
21
- "build": "tsup src/mod.ts",
22
- "check-types": "tsc --noEmit",
23
- "test": "vitest run",
24
- "test:watch": "vitest",
25
- "bench": "tsx benches/actor-lifecycle.bench.ts"
26
- },
27
- "dependencies": {
28
- "@rivetkit/virtual-websocket": "2.2.1-pr.4600.f4b52ef",
29
- "@rivetkit/engine-runner-protocol": "2.2.1-pr.4600.f4b52ef",
30
- "uuid": "^12.0.0",
31
- "pino": "^9.9.5",
32
- "ws": "^8.18.3"
33
- },
34
- "devDependencies": {
35
- "@types/node": "^22.18.1",
36
- "@types/ws": "^8.18.1",
37
- "tinybench": "^5.0.1",
38
- "tsup": "^8.5.0",
39
- "tsx": "^4.20.5",
40
- "typescript": "^5.9.2",
41
- "vitest": "^1.6.1"
42
- }
43
- }
2
+ "name": "@rivetkit/engine-runner",
3
+ "version": "2.2.2-rc.1",
4
+ "type": "module",
5
+ "files": [
6
+ "dist",
7
+ "src",
8
+ "package.json"
9
+ ],
10
+ "exports": {
11
+ "import": {
12
+ "types": "./dist/mod.d.ts",
13
+ "default": "./dist/mod.js"
14
+ },
15
+ "require": {
16
+ "types": "./dist/mod.d.cts",
17
+ "default": "./dist/mod.cjs"
18
+ }
19
+ },
20
+ "dependencies": {
21
+ "uuid": "^12.0.0",
22
+ "pino": "^9.9.5",
23
+ "ws": "^8.18.3",
24
+ "@rivetkit/virtual-websocket": "2.0.33",
25
+ "@rivetkit/engine-runner-protocol": "2.2.2-rc.1"
26
+ },
27
+ "devDependencies": {
28
+ "@types/node": "^22.18.1",
29
+ "@types/ws": "^8.18.1",
30
+ "tinybench": "^5.0.1",
31
+ "tsup": "^8.5.0",
32
+ "tsx": "^4.20.5",
33
+ "typescript": "^5.9.2",
34
+ "vitest": "^1.6.1"
35
+ },
36
+ "scripts": {
37
+ "build": "tsup src/mod.ts",
38
+ "check-types": "tsc --noEmit",
39
+ "test": "vitest run",
40
+ "test:watch": "vitest",
41
+ "bench": "tsx benches/actor-lifecycle.bench.ts"
42
+ }
43
+ }
package/src/mod.ts CHANGED
@@ -287,6 +287,7 @@ export class Runner {
287
287
  const actor = this.getActor(actorId, generation);
288
288
  if (!actor) return;
289
289
 
290
+ actor.stopIntentSent = true;
290
291
  // Keep the actor instance in memory during sleep
291
292
  this.#sendActorIntent(actorId, actor.generation, "sleep");
292
293
 
@@ -1189,6 +1190,13 @@ export class Runner {
1189
1190
  const actorId = commandWrapper.checkpoint.actorId;
1190
1191
  const generation = commandWrapper.checkpoint.generation;
1191
1192
 
1193
+ // CommandStopActor is always an engine-authorized graceful stop (sleep or
1194
+ // destroy). Mark stopIntentSent so #sendActorStateUpdate sends StopCode.Ok
1195
+ // instead of StopCode.Error. The #handleLost path intentionally omits this
1196
+ // mark so unresponsive actors still surface as errors.
1197
+ const actor = this.getActor(actorId, generation);
1198
+ if (actor) actor.stopIntentSent = true;
1199
+
1192
1200
  await this.forceStopActor(actorId, generation);
1193
1201
  }
1194
1202