Skip to content

fix(rivetkit): sleep after run completion#4405

Merged
NathanFlurry merged 5 commits intomainfrom
workflow-error-sleep
Mar 12, 2026
Merged

fix(rivetkit): sleep after run completion#4405
NathanFlurry merged 5 commits intomainfrom
workflow-error-sleep

Conversation

@NathanFlurry
Copy link
Member

@NathanFlurry NathanFlurry commented Mar 11, 2026

Description

Change run handler semantics so actors only destroy when c.destroy() is called explicitly. Finite run handlers, thrown run errors, completed workflows, and handled workflow failures now all leave the actor alive and sleeping when idle, while unhandled workflow-engine errors still surface as run errors.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Added RivetKit driver-test coverage for run-handler exit/error sleep behavior and workflow completion/exhausted-step sleep behavior. Attempted targeted pnpm --filter rivetkit test tests/driver-file-system.test.ts -t "run handler that exits early sleeps instead of destroying|run handler that throws error sleeps instead of destroying|completed workflows sleep instead of destroying the actor|failed workflow steps sleep instead of surfacing as run errors" after pnpm install, but Vitest stopped before test collection because this checkout is missing generated workspace artifacts such as rivetkit-typescript/packages/workflow-engine/dist/schemas/v1.js.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4405 March 11, 2026 23:30 Destroyed
@railway-app
Copy link

railway-app bot commented Mar 11, 2026

🚅 Deployed to the rivet-pr-4405 environment in rivet-frontend

Service Status Web Updated (UTC)
website ✅ Success (View Logs) Web Mar 12, 2026 at 1:19 am
frontend-cloud ✅ Success (View Logs) Web Mar 12, 2026 at 1:18 am
frontend-inspector ✅ Success (View Logs) Web Mar 12, 2026 at 1:18 am
mcp-hub ✅ Success (View Logs) Web Mar 12, 2026 at 1:16 am
ladle ❌ Build Failed (View Logs) Web Mar 11, 2026 at 11:30 pm

@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 11, 2026

More templates

@rivetkit/cloudflare-workers

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/cloudflare-workers@4405

@rivetkit/framework-base

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/framework-base@4405

@rivetkit/next-js

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/next-js@4405

@rivetkit/react

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/react@4405

rivetkit

pnpm add https://pkg.pr.new/rivet-dev/rivet/rivetkit@4405

@rivetkit/sql-loader

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sql-loader@4405

@rivetkit/sqlite-vfs

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/sqlite-vfs@4405

@rivetkit/traces

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/traces@4405

@rivetkit/workflow-engine

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/workflow-engine@4405

@rivetkit/virtual-websocket

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/virtual-websocket@4405

@rivetkit/engine-runner

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner@4405

@rivetkit/engine-runner-protocol

pnpm add https://pkg.pr.new/rivet-dev/rivet/@rivetkit/engine-runner-protocol@4405

commit: 1fa4962

@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4405 March 11, 2026 23:43 Destroyed
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4405 March 12, 2026 00:19 Destroyed
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4405 March 12, 2026 00:53 Destroyed
@railway-app railway-app bot temporarily deployed to rivet-frontend / rivet-pr-4405 March 12, 2026 01:14 Destroyed
@NathanFlurry NathanFlurry merged commit 144960c into main Mar 12, 2026
15 of 18 checks passed
@NathanFlurry NathanFlurry deleted the workflow-error-sleep branch March 12, 2026 01:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant