stablyai/orca · error · Error

--candidate requires a path

Error message

--candidate requires a path

What it means

Thrown by readRequiredValue when --candidate is followed by a null or flag-like token. Identical guard shape to the baseline case: the flag does ++index then readRequiredValue rejects a missing/flag value at compare-benchmark-artifacts.mjs:64-69.

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. Supply a real, non-flag path token immediately after --candidate.
  2. Guard the shell variable: --candidate "${CANDIDATE_PATH:?missing}".
  3. Confirm the candidate artifact file exists at that path before invoking.

Example fix

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

Strategy: validation

Validate before calling

const i = argv.indexOf('--candidate')
if (i !== -1 && (i + 1 >= argv.length || argv[i + 1].startsWith('--'))) {
  throw new Error('--candidate needs a path')
}

Prevention

When it happens

Trigger: Passing '--candidate' last; passing '--candidate --output report.md'; a shell expansion producing an empty candidate path.

Common situations: CI matrix where the candidate artifact path is computed but the job produces none; misordered flags; unquoted path with a leading dash.

Related errors


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