Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class EngineActorDriver implements ActorDriver {

// HACK: Override inspector token (which are likely to be
// removed later on) with token from x-rivet-token header
const token = runConfig.token ?? runConfig.token;
const token = runConfig.token;
if (token && runConfig.inspector && runConfig.inspector.enabled) {
runConfig.inspector.token = () => token;
}
Expand All @@ -116,10 +116,10 @@ export class EngineActorDriver implements ActorDriver {
version: this.#version,
endpoint: getEndpoint(runConfig),
token,
namespace: runConfig.namespace ?? runConfig.namespace,
totalSlots: runConfig.totalSlots ?? runConfig.totalSlots,
runnerName: runConfig.runnerName ?? runConfig.runnerName,
runnerKey: runConfig.runnerKey,
namespace: runConfig.namespace,
totalSlots: runConfig.totalSlots,
runnerName: runConfig.runnerName,
runnerKey: runConfig.runnerKey ?? crypto.randomUUID(),
metadata: {
inspectorToken: this.#runConfig.inspector.token(),
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ export const EngingConfigSchema = z
/** Unique key for this runner. Runners connecting a given key will replace any other runner connected with the same key. */
runnerKey: z
.string()
.default(
() =>
getEnvUniversal("RIVET_RUNNER_KEY") ?? crypto.randomUUID(),
),
.optional()
.transform((x) => x ?? getEnvUniversal("RIVET_RUNNER_KEY")),

/** How many actors this runner can run. */
totalSlots: z.number().default(100_000),
Expand Down
7 changes: 7 additions & 0 deletions rivetkit-typescript/packages/rivetkit/src/manager/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ function addServerlessRoutes(
newRunConfig.totalSlots = totalSlots;
newRunConfig.runnerName = runnerName;
newRunConfig.namespace = namespace;
if (newRunConfig.runnerKey) {
logger().warn({
msg: "runner keys are not supported by serverless runners, this will be overwritten with a random runner key",
oldRunnerKey: newRunConfig.runnerKey,
});
newRunConfig.runnerKey = undefined;
}

// Create new actor driver with updated config
const actorDriver = driverConfig.actor(
Expand Down
Loading