stablyai/orca · error · Error
Unknown argument: ${arg}
Error message
Unknown argument: ${arg} What it means
Thrown by parseArgs in run-idle-cpu-benchmark.mjs when a token is not '--', not a recognized flag, and not a value being consumed. The parser has no positional arguments, so any unrecognized '--foo' or stray token is rejected.
Source
Thrown at config/scripts/run-idle-cpu-benchmark.mjs:99
} else if (arg === '--output') {
options.output = readValue()
} else if (arg === '--skip-build') {
options.skipBuild = true
} else if (arg === '--headful') {
options.headful = true
} else if (arg === '--disable-renderer-animations') {
options.disableRendererAnimations = true
} else if (arg === '--synthetic-visible-spinners') {
options.syntheticVisibleSpinners = Number(readValue())
} else if (arg === '--synthetic-spinner-animation') {
options.syntheticSpinnerAnimation = readValue()
} else if (arg === '--synthetic-spinner-steps') {
options.syntheticSpinnerSteps = Number(readValue())
} else if (arg === '--help') {
printUsage()
process.exit(0)
} else {
throw new Error(`Unknown argument: ${arg}`)
}
}
for (const key of [
'warmupMs',
'sampleMs',
'intervalMs',
'worktrees',
'lineageDepth',
'agentsPerWorktree',
'zustandPublications',
'zustandPublicationIntervalMs',
'syntheticVisibleSpinners',
'syntheticSpinnerSteps'
]) {
if (!Number.isFinite(options[key]) || options[key] < 0) {
throw new Error(`Invalid --${key}: ${options[key]}`)
}
}View on GitHub (pinned to 1136503c6a)
Solutions
- Run --help to list the accepted flags.
- Correct the typo / use the canonical flag name.
- Remove positional arguments; the script takes only flags.
Example fix
# before node config/scripts/run-idle-cpu-benchmark.mjs --agents 4 # after node config/scripts/run-idle-cpu-benchmark.mjs --agents-per-worktree 4
Defensive patterns
Strategy: validation
Validate before calling
const KNOWN_FLAGS = new Set(['--warmup-ms','--sample-ms','--interval-ms','--worktrees','--lineage-depth','--agents-per-worktree','--zustand-publications','--zustand-publication-interval-ms','--output','--skip-build','--headful','--disable-renderer-animations','--synthetic-visible-spinners','--synthetic-spinner-animation','--synthetic-spinner-steps','--help'])
for (const arg of argv) {
if (arg.startsWith('--') && arg !== '--' && !KNOWN_FLAGS.has(arg)) {
throw new Error(`Unknown argument: ${arg}. Run --help.`)
}
} Type guard
function isKnownFlag(arg) { return KNOWN_FLAGS.has(arg) || arg === '--' } Try / catch
try {
options = parseArgs(argv)
} catch (err) {
if (/Unknown argument/.test(err.message)) { printUsage(); process.exit(2) }
throw err
} Prevention
- Keep a single KNOWN_FLAGS source of truth so parse and help agree.
- On unknown-argument errors, print usage and a suggestion (closest known flag).
- Version your CLI flags and document renames to prevent stale invocations.
When it happens
Trigger: Passing a flag not in the known set (e.g. --agents, --pubs, --head), a typo'd flag, or a positional argument the script does not accept.
Common situations: Misspelled flag, flags renamed across versions, assuming a shorthand exists, pasting options from a different tool.
Related errors
- Missing value for ${arg}
- Unknown argument: ${arg}
- --boundary must be child or worker
- --trials must be a positive integer
- Missing value for ${arg}
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/adfd33b3f5c819a8.
Report an issue: GitHub.