stablyai/orca · error · Error
Missing value for ${arg}
Error message
Missing value for ${arg} What it means
Thrown by the readValue() helper in parseArgs (run-idle-cpu-benchmark.mjs) when a value-expecting flag is followed by nothing, or by another flag (a token starting with '--'). readValue guards against silently consuming the next flag as a value.
Source
Thrown at config/scripts/run-idle-cpu-benchmark.mjs:58
worktrees: DEFAULT_WORKTREE_COUNT,
lineageDepth: 0,
agentsPerWorktree: 0,
zustandPublications: 0,
zustandPublicationIntervalMs: DEFAULT_ZUSTAND_PUBLICATION_INTERVAL_MS,
skipBuild: false,
headful: false,
output: null,
disableRendererAnimations: false,
syntheticVisibleSpinners: 0,
syntheticSpinnerAnimation: 'smooth',
syntheticSpinnerSteps: 12
}
for (let index = 0; index < argv.length; index += 1) {
const arg = argv[index]
const readValue = () => {
const value = argv[index + 1]
if (!value || value.startsWith('--')) {
throw new Error(`Missing value for ${arg}`)
}
index += 1
return value
}
if (arg === '--') {
continue
} else if (arg === '--warmup-ms') {
options.warmupMs = Number(readValue())
} else if (arg === '--sample-ms') {
options.sampleMs = Number(readValue())
} else if (arg === '--interval-ms') {
options.intervalMs = Number(readValue())
} else if (arg === '--worktrees') {
options.worktrees = Number(readValue())
} else if (arg === '--lineage-depth') {
options.lineageDepth = Number(readValue())
} else if (arg === '--agents-per-worktree') {
options.agentsPerWorktree = Number(readValue())View on GitHub (pinned to 1136503c6a)
Solutions
- Supply the missing numeric/string value immediately after the flag.
- Re-run with --help to confirm which flags require values.
- Quote shell variables so empty values are visible rather than dropped.
Example fix
# before node config/scripts/run-idle-cpu-benchmark.mjs --warmup-ms --sample-ms 30000 # after node config/scripts/run-idle-cpu-benchmark.mjs --warmup-ms 15000 --sample-ms 30000
Defensive patterns
Strategy: validation
Validate before calling
function readValueAt(argv, index) {
const value = argv[index + 1]
if (!value || value.startsWith('--')) {
throw new Error(`Missing value for ${argv[index]}`)
}
return value
}
// pre-scan: every value-flag must be followed by a non-flag token
const VALUE_FLAGS = new Set(['--warmup-ms','--sample-ms','--interval-ms','--worktrees','--lineage-depth','--agents-per-worktree','--zustand-publications','--zustand-publication-interval-ms','--output','--synthetic-visible-spinners','--synthetic-spinner-animation','--synthetic-spinner-steps'])
for (let i = 0; i < argv.length; i++) {
if (VALUE_FLAGS.has(argv[i]) && (!argv[i+1] || argv[i+1].startsWith('--'))) {
throw new Error(`Missing value for ${argv[i]}`)
}
} Type guard
function isValueFlag(arg) { return VALUE_FLAGS.has(arg) } Try / catch
try {
options = parseArgs(process.argv.slice(2))
} catch (err) {
if (/Missing value for/.test(err.message)) {
printUsage()
process.exit(2)
}
throw err
} Prevention
- Quote shell variables so empty values are explicit, not dropped.
- Validate the arg vector in a preflight pass before consuming values.
- Always expose --help and point users to it on parse errors.
When it happens
Trigger: Passing a numeric/string flag as the last token (e.g. '--warmup-ms' with no following token), or two flags back-to-back like '--output --headful', or '--warmup-ms --sample-ms 30000'.
Common situations: Typos, copy-paste that drops a value, shell quoting that eats an argument, or assuming a flag has a default when it actually requires a value.
Related errors
- Missing value for ${arg}
- Unknown argument: ${arg}
- --boundary must be child or worker
- --trials must be a positive integer
- Unknown argument: ${arg}
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/8a46d9238211b122.
Report an issue: GitHub.