{"record":{"id":"8a46d9238211b122","repo":"stablyai/orca","slug":"missing-value-for-arg-8a46d9","errorCode":null,"errorMessage":"Missing value for ${arg}","messagePattern":"Missing value for (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-idle-cpu-benchmark.mjs","lineNumber":58,"sourceCode":"    worktrees: DEFAULT_WORKTREE_COUNT,\n    lineageDepth: 0,\n    agentsPerWorktree: 0,\n    zustandPublications: 0,\n    zustandPublicationIntervalMs: DEFAULT_ZUSTAND_PUBLICATION_INTERVAL_MS,\n    skipBuild: false,\n    headful: false,\n    output: null,\n    disableRendererAnimations: false,\n    syntheticVisibleSpinners: 0,\n    syntheticSpinnerAnimation: 'smooth',\n    syntheticSpinnerSteps: 12\n  }\n  for (let index = 0; index < argv.length; index += 1) {\n    const arg = argv[index]\n    const readValue = () => {\n      const value = argv[index + 1]\n      if (!value || value.startsWith('--')) {\n        throw new Error(`Missing value for ${arg}`)\n      }\n      index += 1\n      return value\n    }\n    if (arg === '--') {\n      continue\n    } else if (arg === '--warmup-ms') {\n      options.warmupMs = Number(readValue())\n    } else if (arg === '--sample-ms') {\n      options.sampleMs = Number(readValue())\n    } else if (arg === '--interval-ms') {\n      options.intervalMs = Number(readValue())\n    } else if (arg === '--worktrees') {\n      options.worktrees = Number(readValue())\n    } else if (arg === '--lineage-depth') {\n      options.lineageDepth = Number(readValue())\n    } else if (arg === '--agents-per-worktree') {\n      options.agentsPerWorktree = Number(readValue())","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-idle-cpu-benchmark.mjs#L40-L76","documentation":"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.","triggerScenarios":"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'.","commonSituations":"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.","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."],"exampleFix":"# before\nnode config/scripts/run-idle-cpu-benchmark.mjs --warmup-ms --sample-ms 30000\n# after\nnode config/scripts/run-idle-cpu-benchmark.mjs --warmup-ms 15000 --sample-ms 30000","handlingStrategy":"validation","validationCode":"function readValueAt(argv, index) {\n  const value = argv[index + 1]\n  if (!value || value.startsWith('--')) {\n    throw new Error(`Missing value for ${argv[index]}`)\n  }\n  return value\n}\n// pre-scan: every value-flag must be followed by a non-flag token\nconst 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'])\nfor (let i = 0; i < argv.length; i++) {\n  if (VALUE_FLAGS.has(argv[i]) && (!argv[i+1] || argv[i+1].startsWith('--'))) {\n    throw new Error(`Missing value for ${argv[i]}`)\n  }\n}","typeGuard":"function isValueFlag(arg) { return VALUE_FLAGS.has(arg) }","tryCatchPattern":"try {\n  options = parseArgs(process.argv.slice(2))\n} catch (err) {\n  if (/Missing value for/.test(err.message)) {\n    printUsage()\n    process.exit(2)\n  }\n  throw err\n}","preventionTips":["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."],"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"}