fix(rivetkit): auto-spawn engine binary path on local endpoint#5263
Conversation
…space dep pins during release cut
…ry path on local-endpoint auto-spawn
|
🚅 Deployed to the rivet-pr-5263 environment in rivet-frontend
|
|
PR Review: fix(rivetkit): auto-spawn engine binary path on local endpoint 47 additions / 9 deletions across 6 files - release-pipeline bug fixes and one runtime fix. Summary This PR fixes four distinct bugs discovered during the 2.3.0-rc.14 release:
Code Quality native.ts and runtime.ts - silent catch scope The bare cut-release.ts - redundant [workspace.package] write Both npm.ts - warn vs. throw trade-off The hard error becoming a warning is reasonable for re-run recovery, but if someone forgets to bump the version the pipeline continues silently. Consider whether an additional signal (e.g. verifying the git tag does not already exist) should gate forward progress. cut-release.ts - comment style (minor) The new comment uses a semicolon and a parenthetical Potential Bugs bin.ts - verify rivetkit-engine-process transitive deps
version.ts - regex robustness for new dep entry The regex for Security No concerns. Changes do not touch authentication, authorization, or data handling. Test Coverage No unit tests added, but the nature of these fixes makes automated coverage difficult. The described end-to-end validation against a standalone npm project is appropriate. Overall Assessment The fixes are correct and address real, verified bugs that blocked a release. The core fix (unconditional engine path resolution) is sound. The publish ordering and missing-crate fixes are straightforward. Actionable items:
Otherwise, this looks good to merge. |
… before depot-client; allow re-run when npm already published
…process to crates publish list
…fort pass engine binary path; core owns spawn decision
…efore napi compile so it embeds in rivetkit-core
… versions as latest in inspector version gate
…gine binary cannot be resolved
PR Review: fix(rivetkit): auto-spawn engine binary path on local endpointOverall this is a well-scoped fix for a real regression. The primary bug is clearly diagnosed and the fix is correct. Primary fix: native.ts / runtime.tsCorrect. Moving engineBinaryPath resolution outside the if (config.startEngine) guard is the right call. The engine can auto-spawn for any loopback endpoint regardless of startEngine, so core needs the binary path unconditionally. The try/catch is appropriate: binary resolution can legitimately fail on remote-only installs or unsupported platforms, and core is the authority on whether a binary is actually needed. Moving engineHost / enginePort out of the guard is also correct. These are connection parameters, not binary-availability parameters, and should always be set when a local engine is in play. Issue: em dashes in warning messages. Per CLAUDE.md, em dashes should not appear in plain-English writing. The warning strings in both native.ts and runtime.ts contain em dashes. Use a period or semicolon instead. isVersionAtLeast 0.0.0 bypass (actor-inspector-context.tsx)Clean and well-scoped. The 0.0.0 fast-path correctly handles dev/preview builds from pkg.pr.new or branch snapshots. Publish script fixes (bin.ts, npm.ts, version.ts, cut-release.ts)
Dockerfile and turbo.jsonThe build:inspector-ui Turborepo task inputs look complete. SKIP_NAPI_BUILD=1 and SKIP_WASM_BUILD=1 correctly avoid triggering Rust builds in the frontend-only Docker step. The pattern is consistent across all 7 platform Dockerfiles. SummaryThe em dash issue in warning messages is the only actionable item. All other changes are correct and well-reasoned. |
…ia turbo so rivetkit builds first in napi image
…or-ui from napi build.mjs (inverts dep order)
Problem
Running a RivetKit server locally with no env vars (e.g.
registry.start()from hello-world) failed out-of-box on 2.3.0-rc.13:The npm-installed engine binary is present, but the core never learns its path on the auto-spawn path.
Root cause
buildServeConfig(inregistry/native.tsandregistry/runtime.ts) only setsserveConfig.engineBinaryPath = getEnginePath()insideif (config.startEngine). But the Rust core auto-spawns a local engine for any loopback endpoint (EngineSpawnMode::Auto), independent ofstartEngine. So running locally withoutRIVET_RUN_ENGINE=1auto-spawns but has no binary path.Fixes in this PR
engineBinaryPathwhenever the core will manage a local engine (config.startEngine || isLocalEngineEndpoint(config.endpoint)), in bothbuildServeConfigimplementations.cut-release.tsnow bumps theversion = "=X"internal-crate pins (it previously left them on the prior version, breaking the Rust/wasm build during a release cut).RUST_CRATESpublishedrivet-depot-clientbefore its exact dependencyrivet-envoy-protocol, so crates.io publish always failed; and the npm release-mode guard hard-failed on re-runs after npm already published. Both blocked completing a release.rivetkit-coredepends onrivetkit-engine-process, which was missing fromRUST_CRATES, so the crates publish failed atrivetkit-core.Verification
Verified end-to-end against a standalone npm project on the published 2.3.0-rc.14 (which includes fix #1): the engine auto-spawns with no env var, and the full suite passes — HTTP, WebSocket + events, SQLite migrations/CRUD, state + SQLite persistence across restart, instance isolation, error propagation, message-size limits,
tsx --watchhot reload, and the React client in a real browser. Fixes #2-#4 were validated by the 2.3.0-rc.14 release pipeline completing npm + crates.io + git tag + GitHub release.🤖 Generated with Claude Code