{"record":{"id":"5731aeb9b44bdcc0","repo":"stablyai/orca","slug":"missing-value-for-arg-5731ae","errorCode":null,"errorMessage":"Missing value for ${arg}","messagePattern":"Missing value for (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/run-codex-real-account-validation.mjs","lineNumber":272,"sourceCode":"function parseArgs(argv) {\n  const options = {\n    scenario: 'mixed',\n    dryRun: false,\n    closeAfterLaunch: false,\n    skipBuild: false,\n    keep: false,\n    reportPath: null,\n    primaryHome: os.homedir(),\n    configTemplate: null,\n    tempParent: null,\n    laneAwareContainment: false\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 === '--scenario') {\n      options.scenario = readValue()\n    } else if (arg === '--report') {\n      options.reportPath = path.resolve(readValue())\n    } else if (arg === '--primary-home') {\n      options.primaryHome = path.resolve(readValue())\n    } else if (arg === '--config-template') {\n      options.configTemplate = path.resolve(readValue())\n    } else if (arg === '--temp-parent') {\n      options.tempParent = path.resolve(readValue())\n    } else if (arg === '--dry-run') {\n      options.dryRun = true\n    } else if (arg === '--close-after-launch') {\n      options.closeAfterLaunch = true","sourceCodeStart":254,"sourceCodeEnd":290,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/run-codex-real-account-validation.mjs#L254-L290","documentation":"Thrown by the Codex validation harness CLI parser when a value-taking flag (--scenario, --report, --primary-home, --config-template, --temp-parent) is either the last argument or immediately followed by another flag (a token starting with '--'). The readValue() helper enforces that each such flag has a concrete non-flag value.","triggerScenarios":"Passing `--scenario` as the last token, or `--report --keep` where the next token is another flag. The parser checks `!value || value.startsWith('--')`.","commonSituations":"A developer forgets the value, or a shell variable that should hold the value expands to empty.","solutions":["Provide a concrete value after each value-taking flag, e.g. --scenario mixed.","Ensure shell variables are non-empty and do not start with '--'."],"exampleFix":"// before\nnode config/scripts/run-codex-real-account-validation.mjs --scenario\n// after\nnode config/scripts/run-codex-real-account-validation.mjs --scenario mixed","handlingStrategy":"validation","validationCode":"const readValue = () => {\n  const value = argv[index + 1]\n  if (!value || value.startsWith('--')) {\n    throw new Error(`Missing value for ${argv[index]}`)\n  }\n  index += 1\n  return value\n}","typeGuard":"function isFlagValue(value) {\n  return typeof value === 'string' && value.length > 0 && !value.startsWith('--')\n}","tryCatchPattern":null,"preventionTips":["Use '=' syntax (--scenario=mixed) to make value association unambiguous.","Quote shell variables so empty expansions are caught by the startsWith('--') guard."],"tags":["cli","validation","argument-parsing"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}