Skip to content

feat(rivetkit): update rivetkit rust crate#5202

Closed
NathanFlurry wants to merge 2 commits into
stack/feat-depot-support-disabling-sqlite-compaction-via-config-ltzsplvufrom
stack/feat-rivetkit-add-rust-counter-example-qzolvpun
Closed

feat(rivetkit): update rivetkit rust crate#5202
NathanFlurry wants to merge 2 commits into
stack/feat-depot-support-disabling-sqlite-compaction-via-config-ltzsplvufrom
stack/feat-rivetkit-add-rust-counter-example-qzolvpun

Conversation

@NathanFlurry

@NathanFlurry NathanFlurry commented Jun 8, 2026

Copy link
Copy Markdown
Member

No description provided.

@NathanFlurry

NathanFlurry commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

Stack for rivet-dev/rivet

Get stack: forklift get 5202
Push local edits: forklift submit
Merge when ready: forklift merge 5202

@railway-app

railway-app Bot commented Jun 8, 2026

Copy link
Copy Markdown

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

Service Status Web Updated (UTC)
mcp-hub ✅ Success (View Logs) Web Jun 9, 2026 at 8:25 pm
website ❌ Build Failed (View Logs) Web Jun 9, 2026 at 8:25 pm
kitchen-sink ❌ Build Failed (View Logs) Web Jun 9, 2026 at 8:24 pm
frontend-cloud ❌ Build Failed (View Logs) Web Jun 8, 2026 at 11:42 pm
ladle ❌ Build Failed (View Logs) Web Jun 8, 2026 at 11:41 pm
frontend-inspector ❌ Build Failed (View Logs) Web Jun 8, 2026 at 11:41 pm

@claude

claude Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

PR Review: Rust RivetKit Expansion

This is a well-structured expansion of Rust support that maintains good API design principles. Overall the code quality is solid and the additions are cohesive, but a few items warrant attention.


Findings

Potential Runtime Panics from Workflow Events

File: rivetkit-rust/packages/rivetkit/src/event.rs

Workflow event variants now map to unreachable!():

InspectorEvent::WfHistory(_) | InspectorEvent::WfReplay(_) => {
    unreachable!("Rust actors never host workflows")
}

If the engine ever sends these events to a Rust actor (e.g., due to a routing bug or version mismatch), this panics the actor process rather than gracefully degrading. Consider tracing::warn! + skip instead, following the fail-by-default rule only where panics are truly impossible by protocol invariant.


Missing #[serde(skip_serializing_if)] on New Request Fields

File: rivetkit-rust/packages/client/src/remote_manager.rs

The new runner_name_selector and crash_policy fields added to ActorsGetOrCreateRequest / ActorsCreateRequest are serialized unconditionally. Older engine versions that don't recognize these fields may reject the request or behave unexpectedly. Add #[serde(skip_serializing_if = "Option::is_none")] where optional, or confirm the engine always handles unknown fields gracefully.


Silent Error Discard on Response Body Read

File: rivetkit-rust/packages/client/src/remote_manager.rs (improved error message lines)

.unwrap_or_default()

Using .unwrap_or_default() when reading the response body for error messages silently hides body-read failures. Use .unwrap_or_else(|e| format!("<failed to read body: {e}>")) so errors are surfaced in the message.


Test Engine Reuse May Produce Flaky Tests

File: rivetkit-rust/packages/rivetkit/src/test.rs

The shared ENGINE_LOCK + engine reuse pattern is pragmatic but can cause issues if one test leaves the engine in a degraded state — subsequent tests may fail for unrelated reasons. Consider:

  1. Adding a health-check ping before reuse rather than just checking if the JoinHandle is still alive.
  2. Logging the port/PID on engine spawn to aid debugging CI failures.

CBOR Empty Array Deserialization — Comment Could Link to Protocol

File: rivetkit-rust/packages/rivetkit/src/event.rs (action deserialization)

The fix accepting 0x80 (empty CBOR array) as a valid unit variant is correct per the client protocol, but the comment could reference where the client encodes it this way to make the invariant verifiable. A // clients encode zero-arg calls as [] per envoy-client protocol with a file reference would help future readers.


Positive Notes

  • The Queue<A> typed wrapper is clean and well-abstracted over the raw core queue API.
  • Signal handling in registry.rs is correctly gated on cfg(unix) — no portability gaps.
  • Unique pool names using nanosecond timestamps in test.rs correctly prevent cross-test routing interference.
  • The hello-world-rust and chat-room-rust examples are comprehensive and include E2E tests.
  • CLAUDE.md / AGENTS.md symlink added for rivetkit-rust — consistent with repo conventions.
  • The unreachable!() arms on workflow event variants explicitly enumerate the variants rather than using _, consistent with CLAUDE.md's exhaustiveness rule.
  • into_serverless_runtime() is a clean boundary for the serverless deployment model.

@NathanFlurry NathanFlurry force-pushed the stack/feat-rivetkit-add-rust-counter-example-qzolvpun branch from d320950 to 59aec8a Compare June 9, 2026 20:22
@railway-app railway-app Bot temporarily deployed to rivet-frontend / rivet-pr-5202 June 9, 2026 20:22 Destroyed
@NathanFlurry NathanFlurry changed the title feat(rivetkit): add rust counter example feat(rivetkit): update rivetkit rust crate Jun 9, 2026
@NathanFlurry NathanFlurry changed the base branch from stack/refactor-depot-remove-sqlite-cold-storage-oxsukmwr to stack/feat-depot-support-disabling-sqlite-compaction-via-config-ltzsplvu June 9, 2026 20:22
@NathanFlurry NathanFlurry force-pushed the stack/feat-depot-support-disabling-sqlite-compaction-via-config-ltzsplvu branch from a12c0dc to 0bb5420 Compare June 11, 2026 03:45
@NathanFlurry NathanFlurry deleted the stack/feat-rivetkit-add-rust-counter-example-qzolvpun branch June 11, 2026 03:55
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