{"record":{"id":"8af5d282bbc279ba","repo":"stablyai/orca","slug":"unknown-ephemeral-vm-runtime-runtimeid","errorCode":null,"errorMessage":"Unknown ephemeral VM runtime: ${runtimeId}","messagePattern":"Unknown ephemeral VM runtime: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main/ipc/ephemeral-vm-recipe-context.ts","lineNumber":104,"sourceCode":"  }\n  if (repo.connectionId) {\n    return failedRecipeRepo(repo.path, 'Ephemeral VM recipes run on the local desktop host in v1.')\n  }\n  return { ok: true, repo }\n}\n\nexport function getRuntimeRecipeContext(\n  store: Store,\n  userDataPath: string,\n  runtimeId: string\n): {\n  runtime: EphemeralVmRuntimeRecord\n  repo: Extract<RecipeRepoResult, { ok: true }>\n  recipe: OrcaVmRecipe\n} {\n  const runtime = listEphemeralVmRuntimes(userDataPath).find((entry) => entry.id === runtimeId)\n  if (!runtime) {\n    throw new Error(`Unknown ephemeral VM runtime: ${runtimeId}`)\n  }\n  if (!runtime.repoId) {\n    throw new Error(`Ephemeral VM runtime has no repo id: ${runtimeId}`)\n  }\n  const repo = getRecipeRepo(store, runtime.repoId)\n  if (!repo.ok) {\n    throw new Error(repo.message)\n  }\n  // Pre-snapshot runtimes can only be attributed to repo-owned recipes. Never\n  // substitute a later same-id plugin recipe for an older runtime lifecycle.\n  const recipe =\n    runtime.recipe ??\n    (loadHooks(repo.repo.path)?.environmentRecipes ?? []).find(\n      (entry) => entry.id === runtime.recipeId\n    )\n  if (!recipe) {\n    throw new Error(`Recipe not found: ${runtime.recipeId}`)\n  }","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/main/ipc/ephemeral-vm-recipe-context.ts#L86-L122","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-list runtimes (`listEphemeralVmRuntimes`) and use a current id; discard any cached id older than the list.","Confirm the `userDataPath` passed matches the profile that owns the runtime record.","Treat a missing runtime as already-cleaned-up and surface that to the user instead of erroring."],"exampleFix":"// before\nconst ctx = getRuntimeRecipeContext(store, userDataPath, maybeStaleId)\n\n// after\nconst runtimes = listEphemeralVmRuntimes(userDataPath)\nconst current = runtimes.find((r) => r.id === maybeStaleId)\nif (!current) {\n  // runtime already gone; nothing to do\n  return null\n}\nconst ctx = getRuntimeRecipeContext(store, userDataPath, current.id)","handlingStrategy":"validation","validationCode":"// Re-list runtimes and confirm the id is live before resolving context.\nimport { listEphemeralVmRuntimes } from '../../shared/ephemeral-vm-runtime-store'\nconst runtimes = listEphemeralVmRuntimes(userDataPath)\nif (!runtimes.some((r) => r.id === runtimeId)) {\n  // runtime unknown/already cleaned; handle gracefully\n  return null\n}\nreturn getRuntimeRecipeContext(store, userDataPath, runtimeId)","typeGuard":"function runtimeExists(runtimes: { id: string }[], id: string): boolean {\n  return runtimes.some((r) => r.id === id)\n}","tryCatchPattern":"try {\n  return getRuntimeRecipeContext(store, userDataPath, runtimeId)\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Unknown ephemeral VM runtime:')) {\n    // runtime already gone; treat as already-resolved\n    return null\n  }\n  throw e\n}","preventionTips":["Always derive runtime ids from a fresh `listEphemeralVmRuntimes` call, never from a stale cache.","Confirm the userDataPath matches the profile that owns the runtime record.","Treat 'Unknown ephemeral VM runtime' on idempotent operations as a no-op, not an error."],"tags":["ephemeral-vm","runtime","lookup","state","ipc"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}