Skip to content

RivetKit: startEngine: false doesn't reach the native bridge, which still spawns an Engine (EngineSpawnMode::Auto) #5926

Open

Description

@jasonkuhrt

Written by an AI agent (Claude) on behalf of @jasonkuhrt.

A registry set up with startEngine: false can still start its own Engine. The native config bridge never receives that option.

setup({ use, endpoint, startEngine: false /* , ... */ });

We run the Engine ourselves and register runners against it, so a runner should fail registration when the Engine isn't reachable, not start a second one. In rivetkit-napi's serve_config_from_js (2.3.30), the spawn mode is hardcoded to EngineSpawnMode::Auto (registry.rs, around line 845; around line 706 in 2.3.10). startEngine from the TypeScript config doesn't reach it, and RIVETKIT_ENGINE_SPAWN isn't read on that path either.

So with a loopback or *.localhost endpoint, a /health probe that misses its one-second window takes the start-or-reuse path, and the runner process spawns an Engine of its own, which then outlives the stack that owns the real one. Remote endpoints aren't affected.

Expected: startEngine: false maps to the core's Never mode, so the runner never spawns an Engine, and an unreachable Engine fails the runner's normal connection and registration instead.

Activity

  1. linear-code commented on Oct 28, 2026

    @linear-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions