{"record":{"id":"adfd33b3f5c819a8","repo":"stablyai/orca","slug":"unknown-argument-arg-adfd33","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-idle-cpu-benchmark.mjs","lineNumber":99,"sourceCode":"    } else if (arg === '--output') {\n      options.output = readValue()\n    } else if (arg === '--skip-build') {\n      options.skipBuild = true\n    } else if (arg === '--headful') {\n      options.headful = true\n    } else if (arg === '--disable-renderer-animations') {\n      options.disableRendererAnimations = true\n    } else if (arg === '--synthetic-visible-spinners') {\n      options.syntheticVisibleSpinners = Number(readValue())\n    } else if (arg === '--synthetic-spinner-animation') {\n      options.syntheticSpinnerAnimation = readValue()\n    } else if (arg === '--synthetic-spinner-steps') {\n      options.syntheticSpinnerSteps = Number(readValue())\n    } else if (arg === '--help') {\n      printUsage()\n      process.exit(0)\n    } else {\n      throw new Error(`Unknown argument: ${arg}`)\n    }\n  }\n  for (const key of [\n    'warmupMs',\n    'sampleMs',\n    'intervalMs',\n    'worktrees',\n    'lineageDepth',\n    'agentsPerWorktree',\n    'zustandPublications',\n    'zustandPublicationIntervalMs',\n    'syntheticVisibleSpinners',\n    'syntheticSpinnerSteps'\n  ]) {\n    if (!Number.isFinite(options[key]) || options[key] < 0) {\n      throw new Error(`Invalid --${key}: ${options[key]}`)\n    }\n  }","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-idle-cpu-benchmark.mjs#L81-L117","documentation":"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.","triggerScenarios":"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.","commonSituations":"Misspelled flag, flags renamed across versions, assuming a shorthand exists, pasting options from a different tool.","solutions":["Run --help to list the accepted flags.","Correct the typo / use the canonical flag name.","Remove positional arguments; the script takes only flags."],"exampleFix":"# before\nnode config/scripts/run-idle-cpu-benchmark.mjs --agents 4\n# after\nnode config/scripts/run-idle-cpu-benchmark.mjs --agents-per-worktree 4","handlingStrategy":"validation","validationCode":"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'])\nfor (const arg of argv) {\n  if (arg.startsWith('--') && arg !== '--' && !KNOWN_FLAGS.has(arg)) {\n    throw new Error(`Unknown argument: ${arg}. Run --help.`)\n  }\n}","typeGuard":"function isKnownFlag(arg) { return KNOWN_FLAGS.has(arg) || arg === '--' }","tryCatchPattern":"try {\n  options = parseArgs(argv)\n} catch (err) {\n  if (/Unknown argument/.test(err.message)) { printUsage(); process.exit(2) }\n  throw err\n}","preventionTips":["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."],"tags":["cli","arguments","validation","benchmark"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}