stablyai/orca · error · Error

Missing value for ${arg}

Error message

Missing value for ${arg}

What it means

CLI argument parser rejects --expect, --trials, or --output when no value follows. The parser reads argv[index+1] as the value; if it is undefined (flag is the last token) or an empty string, the check at line 396 (!value) fires. Note: if the next token is another flag like --trials, it is truthy and gets consumed as the value instead, producing a different error downstream.

Source

Thrown at config/scripts/macos-computer-helper-owner-loss-benchmark.mjs:397

      abruptExitMs: abruptExitMs === null ? null : Math.round(abruptExitMs),
      postLossRssBytes,
      gracefulExitMs
    }
  } finally {
    invalidPeer?.destroy()
    sidecar?.child.kill('SIGKILL')
    await stopProcess(helper)
  }
}

function parseArgs(argv) {
  const options = { expect: '', trials: DEFAULT_TRIALS, output: '' }
  for (let index = 0; index < argv.length; index += 1) {
    const arg = argv[index]
    const value = argv[index + 1]
    if (arg === '--expect' || arg === '--trials' || arg === '--output') {
      if (!value) {
        throw new Error(`Missing value for ${arg}`)
      }
      options[arg.slice(2)] = arg === '--trials' ? Number(value) : value
      index += 1
    } else {
      throw new Error(`Unknown argument: ${arg}`)
    }
  }
  if (!['retained', 'reaped'].includes(options.expect)) {
    throw new Error('--expect must be retained or reaped')
  }
  if (!Number.isInteger(options.trials) || options.trials < 1) {
    throw new Error('--trials must be a positive integer')
  }
  return options
}

function electronPath() {
  const electronModulePath = fileURLToPath(import.meta.resolve('electron'))

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Provide a value immediately after the flag: `--expect reaped`
  2. Check shell variable expansion — ensure the variable is set and non-empty before interpolation
  3. Quote the entire argument pair if constructing the command programmatically

Example fix

// before
node benchmark.mjs --expect

// after
node benchmark.mjs --expect reaped
Defensive patterns

Strategy: validation

Validate before calling

// Validate argv before parseArgs
const KNOWN_FLAGS = ['--expect', '--trials', '--output']
for (let i = 0; i < argv.length; i++) {
  if (KNOWN_FLAGS.includes(argv[i])) {
    if (!argv[i + 1]) {
      throw new Error(`${argv[i]} requires a value — check shell quoting`)
    }
  }
}

Prevention

When it happens

Trigger: The flag is the last token in argv (e.g., `node benchmark.mjs --expect` with nothing after it), or the shell passes an empty string as the next token. argv[index+1] is undefined or ''.

Common situations: Shell quoting error drops the value (e.g., --expect $UNSET_VAR where the var is empty); script wrapper truncates args; copy-paste from docs omits the value; the flag is accidentally placed at the end of a concatenated command.

Related errors


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