fix(rivetkit): preserve engine bind defaults - #5643
Open
eersnington wants to merge 1 commit into
Open
Conversation
eersnington
force-pushed
the
stack/fix-rivetkit-preserve-engine-bind-defaults-rqsvztrk
branch
from
September 2, 2026 21:15
c1f2e1f to
2b600fd
Compare
11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
That port was hard-coded to 6420 in the TypeScript registry config, even if you passed an
endpointon a different port. Result: the client waits on the port you asked for, the Engine listens on 6420, nothing connects.The Rust side already had the right logic: use the bind port if set, otherwise use the endpoint's port. The TypeScript config just never let the bind port be unset (
enginePorthad.default(6420)), so that fallback never ran.The fix: leave the bind host and port unset unless you configure them, and only apply
127.0.0.1:6420when RivetKit builds its own local Engine URL.What changes:
enginePort: used as before. Unchanged.endpoint: the Engine now listens on that endpoint's port. This never worked before.Production is not affected. Deployed apps connect to a remote Engine and never spawn one. This only matters for local dev and for tests that spawn an Engine on a random port, which is how it was found.
Four lines in
registry/config/index.tsplus a constructor test.Note for test authors: a spawned Engine keeps running after its parent exits, and the next process reuses it if it is healthy at the same address. Now that random ports work, a test that picks a new port each run gets a new Engine each run. Such tests should set
RIVETKIT_STORAGE_PATHper run and stop their Engine on teardown, otherwise the previous run's Engine keeps the database locked.Type of change
How Has This Been Tested?
Checklist: