stablyai/orca · error

Unknown ephemeral VM runtime: ${runtimeId}

Error message

Unknown ephemeral VM runtime: ${runtimeId}

What it means

Thrown by `getRuntimeRecipeContext` when no ephemeral VM runtime record matches `runtimeId` in `listEphemeralVmRuntimes(userDataPath)`. Runtime records are persisted under the app's userData directory; a miss means the id was never created, was deleted, or was passed incorrectly. This is the authoritative lookup used by recipe-resolution paths.

Source

Thrown at src/main/ipc/ephemeral-vm-recipe-context.ts:104

  }
  if (repo.connectionId) {
    return failedRecipeRepo(repo.path, 'Ephemeral VM recipes run on the local desktop host in v1.')
  }
  return { ok: true, repo }
}

export function getRuntimeRecipeContext(
  store: Store,
  userDataPath: string,
  runtimeId: string
): {
  runtime: EphemeralVmRuntimeRecord
  repo: Extract<RecipeRepoResult, { ok: true }>
  recipe: OrcaVmRecipe
} {
  const runtime = listEphemeralVmRuntimes(userDataPath).find((entry) => entry.id === runtimeId)
  if (!runtime) {
    throw new Error(`Unknown ephemeral VM runtime: ${runtimeId}`)
  }
  if (!runtime.repoId) {
    throw new Error(`Ephemeral VM runtime has no repo id: ${runtimeId}`)
  }
  const repo = getRecipeRepo(store, runtime.repoId)
  if (!repo.ok) {
    throw new Error(repo.message)
  }
  // Pre-snapshot runtimes can only be attributed to repo-owned recipes. Never
  // substitute a later same-id plugin recipe for an older runtime lifecycle.
  const recipe =
    runtime.recipe ??
    (loadHooks(repo.repo.path)?.environmentRecipes ?? []).find(
      (entry) => entry.id === runtime.recipeId
    )
  if (!recipe) {
    throw new Error(`Recipe not found: ${runtime.recipeId}`)
  }

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Re-list runtimes (`listEphemeralVmRuntimes`) and use a current id; discard any cached id older than the list.
  2. Confirm the `userDataPath` passed matches the profile that owns the runtime record.
  3. Treat a missing runtime as already-cleaned-up and surface that to the user instead of erroring.

Example fix

// before
const ctx = getRuntimeRecipeContext(store, userDataPath, maybeStaleId)

// after
const runtimes = listEphemeralVmRuntimes(userDataPath)
const current = runtimes.find((r) => r.id === maybeStaleId)
if (!current) {
  // runtime already gone; nothing to do
  return null
}
const ctx = getRuntimeRecipeContext(store, userDataPath, current.id)
Defensive patterns

Strategy: validation

Validate before calling

// Re-list runtimes and confirm the id is live before resolving context.
import { listEphemeralVmRuntimes } from '../../shared/ephemeral-vm-runtime-store'
const runtimes = listEphemeralVmRuntimes(userDataPath)
if (!runtimes.some((r) => r.id === runtimeId)) {
  // runtime unknown/already cleaned; handle gracefully
  return null
}
return getRuntimeRecipeContext(store, userDataPath, runtimeId)

Type guard

function runtimeExists(runtimes: { id: string }[], id: string): boolean {
  return runtimes.some((r) => r.id === id)
}

Try / catch

try {
  return getRuntimeRecipeContext(store, userDataPath, runtimeId)
} catch (e) {
  if (e instanceof Error && e.message.startsWith('Unknown ephemeral VM runtime:')) {
    // runtime already gone; treat as already-resolved
    return null
  }
  throw e
}

Prevention

When it happens

Trigger: Calling `getRuntimeRecipeContext(store, userDataPath, runtimeId)` with an id that is not present in the persisted runtime store, e.g. after the runtime was cleaned up, expired, or never created.

Common situations: Stale UI holding a runtime id after cleanup/refresh; a runtime id copy-paste or serialization mismatch; concurrent cleanup by another flow deleting the record between listing and lookup; calling with an id from a different user profile / userData path.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/8af5d282bbc279ba. Report an issue: GitHub.