stablyai/orca · error · Error

--baseline requires a path

Error message

--baseline requires a path

What it means

Thrown by readRequiredValue (compare-benchmark-artifacts.mjs:64-69) when --baseline is immediately followed by a missing argument or by another flag (a token starting with '--'). The flag consumes its value via readRequiredValue(args, ++index, ...), so a null or flag-like next token means no path was given.

Source

Thrown at config/scripts/compare-benchmark-artifacts.mjs:67

      }
      continue
    }
    throw new Error(USAGE)
  }

  if (!parsed.baselinePath) {
    throw new Error(USAGE)
  }
  if (!parsed.candidatePath) {
    throw new Error(USAGE)
  }
  return parsed
}

function readRequiredValue(args, index, message) {
  const value = args[index]
  if (value == null || value.startsWith('--')) {
    throw new Error(message)
  }
  return value
}

export function readBenchmarkArtifact(path) {
  return JSON.parse(readFileSync(path, 'utf8'))
}

export function normalizeBenchmarkArtifact(path, artifact = readBenchmarkArtifact(path)) {
  if (artifact?.summaryMedianMs != null) {
    return normalizeNumericObject(path, artifact, 'startup', artifact.summaryMedianMs, () => 'ms')
  }
  if (artifact?.summaryMedian != null) {
    return normalizeNumericObject(path, artifact, 'daemon', artifact.summaryMedian, (key) =>
      key.endsWith('Count') || key.endsWith('After') ? 'count' : 'ms'
    )
  }
  if (artifact?.suites != null) {

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Provide a real path token after --baseline that does not start with '--'.
  2. Ensure any shell variable used for the path is set and non-empty: --baseline "${BASELINE_PATH:?missing}".
  3. Quote paths so spaces or special characters do not split the token.

Example fix

// before
parseBenchmarkComparisonArgs(['--baseline', '--candidate', 'c.json'])
// after
parseBenchmarkComparisonArgs(['--baseline', 'b.json', '--candidate', 'c.json'])
Defensive patterns

Strategy: validation

Validate before calling

function hasValueAfter(argv, flag) {
  const i = argv.indexOf(flag)
  return i !== -1 && i + 1 < argv.length && !argv[i + 1].startsWith('--')
}
if (!hasValueAfter(argv, '--baseline')) throw new Error('--baseline needs a path')

Prevention

When it happens

Trigger: Passing '--baseline' as the last argument; passing '--baseline --candidate ...' (baseline value omitted); passing '--baseline --title foo' where the next token is another flag.

Common situations: Typing the command and accidentally dropping the path; a shell variable expanding to empty (e.g. --baseline $BASELINE_PATH with BASELINE_PATH unset); flag-ordering mistakes in a generated command line.

Related errors


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