stablyai/orca · error · RuntimeClientError

invalid_argument

invalid_argument

Error message

Missing recipe id.

What it means

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.

Source

Thrown at src/cli/handlers/vm.ts:28

} from '../../shared/ephemeral-vm-recipes'
import {
  getEphemeralVmRecipeResultWarnings,
  redactEphemeralVmRecipeDiagnosticText
} from '../../shared/ephemeral-vm-recipe-diagnostics'
// Why: import directly from the doctor module (not the barrel) — it uses Node
// fs/path and must stay out of the browser bundle that imports the barrel.
import { doctorEphemeralVmRecipe } from '../../shared/ephemeral-vm-recipe-doctor'
import {
  runEphemeralVmRecipeCleanup,
  runEphemeralVmRecipeStart
} from '../../shared/ephemeral-vm-recipe-runner'
import type { OrcaVmRecipe } from '../../shared/types'

export const VM_HANDLERS: Record<string, CommandHandler> = {
  'vm recipe doctor': async ({ flags, cwd, json }) => {
    const recipeId = getStringFlag(flags, 'recipe-id')
    if (!recipeId) {
      throw new RuntimeClientError('invalid_argument', 'Missing recipe id.')
    }
    const repoPath = getStringFlag(flags, 'repo-path') ?? cwd
    const shouldProvision = flags.get('provision') === true || flags.get('connect') === true
    const result = shouldProvision
      ? await doctorRecipeWithProvision(repoPath, recipeId)
      : doctorRecipe(repoPath, recipeId)
    if (json) {
      console.log(JSON.stringify(result, null, 2))
    } else {
      console.log(formatDoctorResult(result))
    }
    if (!result.ok) {
      process.exitCode = 1
    }
  }
}

function doctorRecipe(repoPath: string, recipeId: string): DoctorResult {

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Pass `--recipe-id <id>` naming the recipe to doctor.
  2. Confirm the recipe id exists in your recipe registry/config before running.
  3. In scripts, fail fast if the id variable is empty rather than invoking orca.
  4. Use `--repo-path` (optional) only if you also need to override the repo; it does not substitute for recipe-id.

Example fix

// before
orca vm recipe doctor
RECIPE=
orca vm recipe doctor --recipe-id "$RECIPE"
// after
orca vm recipe doctor --recipe-id <recipe-id>
orca vm recipe doctor --recipe-id <recipe-id> --repo-path /path/to/repo
Defensive patterns

Strategy: validation

Validate before calling

const recipeId = getStringFlag(flags, 'recipe-id')
if (!recipeId) { /* fail early with a clear message before vm recipe doctor */ }

Type guard

function hasRecipeId(flags: Map<string, string | boolean>): boolean {
  const v = flags.get('recipe-id')
  return typeof v === 'string' && v.length > 0
}

Try / catch

try { await vmRecipeDoctor(flags) }
catch (e) {
  if (e instanceof RuntimeClientError && e.code === 'invalid_argument' && e.message === 'Missing recipe id.') {
    // prompt for / resolve the recipe id, then retry
  } else throw e
}

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


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