stablyai/orca · error · Error
${name} must be a positive integer, received ${value}
Error message
${name} must be a positive integer, received ${value} What it means
The session-hydration worktree-lookup benchmark reads ORCA_HYDRATE_BENCH_ITERATIONS (default 60) and ORCA_HYDRATE_BENCH_WARMUP (default 10) from the environment and validates both are positive safe integers before timing. Number.isSafeInteger rejects NaN, floats, Infinity, and values beyond 2^53; the <= 0 check rejects zero and negatives. Bad values would otherwise produce silent garbage timings or divide-by-zero in the per-iteration math.
Source
Thrown at config/scripts/hydrate-worktree-lookup-benchmark.mjs:26
// This runs on the renderer's synchronous cold-start path and gates workspaceSessionReady,
// which blocks terminal pane mounting, so the cost is paid before the first frame.
//
// Both arms produce the resolved rows and are compared for equality before timing, so an
// index that resolved differently could not be reported as a win.
//
// Run with: node config/scripts/hydrate-worktree-lookup-benchmark.mjs
import { performance } from 'node:perf_hooks'
const ITERATIONS = Number(process.env.ORCA_HYDRATE_BENCH_ITERATIONS ?? '60')
const WARMUP = Number(process.env.ORCA_HYDRATE_BENCH_WARMUP ?? '10')
const ROUNDS = 6
for (const [name, value] of [
['ORCA_HYDRATE_BENCH_ITERATIONS', ITERATIONS],
['ORCA_HYDRATE_BENCH_WARMUP', WARMUP]
]) {
if (!Number.isSafeInteger(value) || value <= 0) {
throw new Error(`${name} must be a positive integer, received ${value}`)
}
}
// Pre-fix: re-flatten and linear-search per id.
function resolveByFlatten(worktreesByRepo, ids) {
const resolved = []
for (const id of ids) {
const worktree = Object.values(worktreesByRepo)
.flat()
.find((entry) => entry.id === id)
resolved.push(worktree ? worktree.repoId : null)
}
return resolved
}
// Post-fix: mirrors buildWorktreeByIdIndex in store/slices/worktree-by-id-index.ts.
function resolveByIndex(worktreesByRepo, ids) {
const index = new Map()View on GitHub (pinned to 1136503c6a)
Solutions
- Unset both env vars to fall back to the documented defaults (60 iterations, 10 warmup).
- Set each to a plain positive integer string with no decimals, signs, or commas.
- If you need larger runs, keep the value under Number.MAX_SAFE_INTEGER.
Example fix
# before export ORCA_HYDRATE_BENCH_ITERATIONS='1.5' # after unset ORCA_HYDRATE_BENCH_ITERATIONS ORCA_HYDRATE_BENCH_WARMUP
Defensive patterns
Strategy: validation
Validate before calling
function parsePositiveIntEnv(name, fallback) {
const raw = process.env[name]
if (!raw) return fallback
const n = Number(raw)
if (!Number.isSafeInteger(n) || n <= 0) {
throw new Error(`${name} must be a positive integer, received ${raw}`)
}
return n
} Prevention
- Leave ORCA_HYDRATE_BENCH_* unset in CI unless you need a non-default size.
- Never include decimals, signs, or trailing commas in these env vars.
When it happens
Trigger: Setting ORCA_HYDRATE_BENCH_ITERATIONS or ORCA_HYDRATE_BENCH_WARMUP to '0', a negative number, a decimal like '1.5', a non-numeric string, or a value exceeding Number.MAX_SAFE_INTEGER.
Common situations: Typo in the env var name (leaving it unset is fine and uses defaults); passing a decimal or a trailing-space value in CI matrix config; copy-pasting '60,' with a trailing comma that maps to NaN.
Related errors
- ${name} must be a positive integer, received ${value}
- ${name} must be a positive integer, received ${value}
- ORCA_ADVERTISED_URL_BENCH_ROUNDS must be even
- ${name} must be a positive integer, received ${value}
- ${name} must be a positive integer, received ${value}
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/110488c3b704a1ef.
Report an issue: GitHub.