{"record":{"id":"21bf56002f91dd29","repo":"stablyai/orca","slug":"invalid-argument-21bf56","errorCode":"invalid_argument","errorMessage":"Missing recipe id.","messagePattern":"Missing recipe id\\.","errorType":"exception","errorClass":"RuntimeClientError","httpStatus":null,"severity":"error","filePath":"src/cli/handlers/vm.ts","lineNumber":28,"sourceCode":"} from '../../shared/ephemeral-vm-recipes'\nimport {\n  getEphemeralVmRecipeResultWarnings,\n  redactEphemeralVmRecipeDiagnosticText\n} from '../../shared/ephemeral-vm-recipe-diagnostics'\n// Why: import directly from the doctor module (not the barrel) — it uses Node\n// fs/path and must stay out of the browser bundle that imports the barrel.\nimport { doctorEphemeralVmRecipe } from '../../shared/ephemeral-vm-recipe-doctor'\nimport {\n  runEphemeralVmRecipeCleanup,\n  runEphemeralVmRecipeStart\n} from '../../shared/ephemeral-vm-recipe-runner'\nimport type { OrcaVmRecipe } from '../../shared/types'\n\nexport const VM_HANDLERS: Record<string, CommandHandler> = {\n  'vm recipe doctor': async ({ flags, cwd, json }) => {\n    const recipeId = getStringFlag(flags, 'recipe-id')\n    if (!recipeId) {\n      throw new RuntimeClientError('invalid_argument', 'Missing recipe id.')\n    }\n    const repoPath = getStringFlag(flags, 'repo-path') ?? cwd\n    const shouldProvision = flags.get('provision') === true || flags.get('connect') === true\n    const result = shouldProvision\n      ? await doctorRecipeWithProvision(repoPath, recipeId)\n      : doctorRecipe(repoPath, recipeId)\n    if (json) {\n      console.log(JSON.stringify(result, null, 2))\n    } else {\n      console.log(formatDoctorResult(result))\n    }\n    if (!result.ok) {\n      process.exitCode = 1\n    }\n  }\n}\n\nfunction doctorRecipe(repoPath: string, recipeId: string): DoctorResult {","sourceCodeStart":10,"sourceCodeEnd":46,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/src/cli/handlers/vm.ts#L10-L46","documentation":"Thrown by the `vm recipe doctor` handler when `--recipe-id` is missing or falsy (getStringFlag returns null). The recipe id is required because the doctor must know which recipe definition to validate; there is no default or cwd-derived fallback. Client-side guard before any recipe loading.","triggerScenarios":"Running `orca vm recipe doctor` without `--recipe-id`, or with an empty value (the repo-path is optional and defaults to cwd, but recipe-id is not).","commonSituations":"Forgetting the flag; assuming the recipe is inferred from the repo; a script that conditionally sets RECIPE but leaves it empty; wrong subcommand expecting a positional id.","solutions":["Pass `--recipe-id <id>` naming the recipe to doctor.","Confirm the recipe id exists in your recipe registry/config before running.","In scripts, fail fast if the id variable is empty rather than invoking orca.","Use `--repo-path` (optional) only if you also need to override the repo; it does not substitute for recipe-id."],"exampleFix":"// before\norca vm recipe doctor\nRECIPE=\norca vm recipe doctor --recipe-id \"$RECIPE\"\n// after\norca vm recipe doctor --recipe-id <recipe-id>\norca vm recipe doctor --recipe-id <recipe-id> --repo-path /path/to/repo","handlingStrategy":"validation","validationCode":"const recipeId = getStringFlag(flags, 'recipe-id')\nif (!recipeId) { /* fail early with a clear message before vm recipe doctor */ }","typeGuard":"function hasRecipeId(flags: Map<string, string | boolean>): boolean {\n  const v = flags.get('recipe-id')\n  return typeof v === 'string' && v.length > 0\n}","tryCatchPattern":"try { await vmRecipeDoctor(flags) }\ncatch (e) {\n  if (e instanceof RuntimeClientError && e.code === 'invalid_argument' && e.message === 'Missing recipe id.') {\n    // prompt for / resolve the recipe id, then retry\n  } else throw e\n}","preventionTips":["Fail fast in scripts when the recipe-id variable is empty.","Confirm the recipe exists in your registry before doctoring it.","Remember repo-path defaults to cwd but recipe-id never has a default."],"tags":["cli","validation","vm","recipe","missing-argument","invalid-argument"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}