stablyai/orca · error

Unknown ephemeral VM runtime: ${args.runtimeId}

Error message

Unknown ephemeral VM runtime: ${args.runtimeId}

What it means

Thrown by the `ephemeralVm:cleanup` IPC handler when `listEphemeralVmRuntimes(userDataPath).find(id === args.runtimeId)` returns undefined. This is a defensive pre-check before delegating to `getRuntimeRecipeContext`; it lets the handler return a `cleanup_failed` status update rather than propagating the recipe-context error. Identical in cause to 1106 but at the IPC handler boundary.

Source

Thrown at src/main/ipc/ephemeral-vm-runtime-handlers.ts:71

  ipcMain.handle(
    'ephemeralVm:attachWorkspace',
    (_event, args: { runtimeId: string; workspaceId: string }): EphemeralVmRuntimeRecord => {
      return updateEphemeralVmRuntimeStatus(app.getPath('userData'), args.runtimeId, {
        status: 'running',
        workspaceId: args.workspaceId
      })
    }
  )

  ipcMain.handle(
    'ephemeralVm:cleanup',
    async (_event, args: { runtimeId: string }): Promise<EphemeralVmRuntimeRecord> => {
      const userDataPath = app.getPath('userData')
      const runtime = listEphemeralVmRuntimes(userDataPath).find(
        (entry) => entry.id === args.runtimeId
      )
      if (!runtime) {
        throw new Error(`Unknown ephemeral VM runtime: ${args.runtimeId}`)
      }
      if (!runtime.repoId) {
        throw new Error(`Ephemeral VM runtime has no repo id: ${args.runtimeId}`)
      }
      let resolved: ReturnType<typeof getRuntimeRecipeContext>
      try {
        resolved = getRuntimeRecipeContext(store, userDataPath, runtime.id)
      } catch (error) {
        return updateEphemeralVmRuntimeStatus(userDataPath, runtime.id, {
          status: 'cleanup_failed',
          cleanupStatus: 'failed',
          cleanupLastAttemptAt: Date.now(),
          cleanupLastError: error instanceof Error ? error.message : String(error)
        })
      }
      const result = await cleanupEphemeralVmRuntime({
        userDataPath,
        repoPath: resolved.repo.repo.path,

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Refresh the runtime list before offering cleanup actions so only live ids are selectable.
  2. Treat 'Unknown ephemeral VM runtime' on cleanup as a no-op success (the runtime is already gone).
  3. Verify the runtimeId matches a record from `listEphemeralVmRuntimes` for the current profile before invoking.

Example fix

// before
await ipcRenderer.invoke('ephemeralVm:cleanup', { runtimeId: cachedId })

// after
const live = await ipcRenderer.invoke('ephemeralVm:listRuntimes')
if (!live.some((r) => r.id === cachedId)) {
  // already cleaned up; nothing to do
  return { status: 'already_clean' }
}
await ipcRenderer.invoke('ephemeralVm:cleanup', { runtimeId: cachedId })
Defensive patterns

Strategy: validation

Validate before calling

// Refresh the runtime list before offering cleanup; only invoke for live ids.
const live = await ipcRenderer.invoke('ephemeralVm:listRuntimes')
if (!live.some((r) => r.id === runtimeId)) {
  // already cleaned up; treat as success
  return { status: 'already_clean' }
}
await ipcRenderer.invoke('ephemeralVm:cleanup', { runtimeId })

Type guard

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

Try / catch

try {
  await ipcRenderer.invoke('ephemeralVm:cleanup', { runtimeId })
} catch (e) {
  if (e instanceof Error && e.message.startsWith('Unknown ephemeral VM runtime:')) {
    // already gone; nothing to clean
    return
  }
  throw e
}

Prevention

When it happens

Trigger: Invoking `ipcRenderer.invoke('ephemeralVm:cleanup', { runtimeId })` for a runtime id that is not in the persisted runtime store (already cleaned, expired, wrong profile, or typo).

Common situations: User clicks cleanup on a runtime list that is stale; double-cleanup (the record was already removed by a prior call); runtime id from a different userData profile; id corrupted in transit.

Related errors


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