stablyai/orca · error · Error

Unknown argument: ${arg}

Error message

Unknown argument: ${arg}

What it means

CLI argument parser encounters a token that is not --expect, --trials, or --output. These are the only three recognized flags; any other token (including short flags, positional args, or typos) hits the else branch at line 401.

Source

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

    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'))
  return execFileSync(
    process.execPath,
    ['-e', `process.stdout.write(require(${JSON.stringify(electronModulePath)}))`],
    { encoding: 'utf8' }
  )

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Remove the unrecognized argument
  2. Verify the supported flags: --expect (retained|reaped), --trials (positive int), --output (path)
  3. Check for typos in flag names

Example fix

// before
node benchmark.mjs --verbose --expect reaped

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

Strategy: validation

Validate before calling

// Validate all args are known before parsing
const KNOWN_FLAGS = new Set(['--expect', '--trials', '--output'])
for (const arg of argv) {
  if (arg.startsWith('--') && !KNOWN_FLAGS.has(arg)) {
    throw new Error(`Unsupported flag: ${arg}. Supported: --expect, --trials, --output`)
  }
}

Prevention

When it happens

Trigger: Any unrecognized argument: --verbose, -v, --help, a bare positional path, or a typo like --exepect. The token does not match any of the three known flags.

Common situations: Typo in a flag name; passing a flag from an older/newer version of the script; a wrapper script adds extra args; user expects --help or --version to work.

Related errors


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