{"record":{"id":"a3d529a5b15411c0","repo":"affaan-m/ECC","slug":"timeout-seconds-must-be-an-integer-from-10-to-12","errorCode":null,"errorMessage":"--timeout-seconds must be an integer from 10 to 120","messagePattern":"--timeout-seconds must be an integer from 10 to 120","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"skills/council-multi-model/scripts/review-with-codex.js","lineNumber":67,"sourceCode":"\nfunction parseArgs(argv) {\n  const options = {\n    consent: false,\n    hostProvider: null,\n    timeoutMs: DEFAULT_TIMEOUT_MS,\n  };\n\n  for (let index = 0; index < argv.length; index += 1) {\n    const arg = argv[index];\n    if (arg === '--consent-to-openai') {\n      options.consent = true;\n    } else if (arg === '--host-provider') {\n      options.hostProvider = argv[index + 1];\n      index += 1;\n    } else if (arg === '--timeout-seconds') {\n      const seconds = Number(argv[index + 1]);\n      if (!Number.isInteger(seconds) || seconds < 10 || seconds > 120) {\n        throw new Error('--timeout-seconds must be an integer from 10 to 120');\n      }\n      options.timeoutMs = seconds * 1000;\n      index += 1;\n    } else if (arg === '--help' || arg === '-h') {\n      options.help = true;\n    } else {\n      throw new Error(`unknown argument: ${arg}`);\n    }\n  }\n\n  if (options.help) return options;\n  if (!options.consent) {\n    throw new Error('explicit --consent-to-openai is required');\n  }\n  if (!HOST_PROVIDERS.has(options.hostProvider)) {\n    throw new Error('--host-provider must be anthropic, openai, or unknown');\n  }\n  return options;","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/council-multi-model/scripts/review-with-codex.js#L49-L85","documentation":"parseArgs in review-with-codex.js validates --timeout-seconds strictly: it must parse to an integer between 10 and 120 inclusive, because the value becomes the Codex CLI probe timeout in milliseconds. The error is thrown immediately during argument parsing when Number() yields NaN, a float, or an out-of-range value.","triggerScenarios":"Passing `--timeout-seconds abc` (NaN), `--timeout-seconds 5.5` (non-integer), `--timeout-seconds 5` (< 10), or `--timeout-seconds 300` (> 120). Also occurs when the value is missing entirely so Number(undefined) is NaN.","commonSituations":"User assumes seconds are optional/unbounded; passing milliseconds by mistake (e.g. 30000); a wrapper script interpolates an empty or unit-suffixed value like `30s`; forgetting the flag value so the next flag is consumed by Number().","solutions":["Pass an integer between 10 and 120, e.g. `--timeout-seconds 30`.","If you have a millisecond value, divide by 1000 before passing it.","Ensure the flag is followed by a bare numeric value with no unit suffix.","Remove the flag entirely to use the script's default timeout if you don't need a custom one."],"exampleFix":"// before\nnode review-with-codex.js --timeout-seconds 300 ...\n// Error: --timeout-seconds must be an integer from 10 to 120\n\n// after\nnode review-with-codex.js --timeout-seconds 120 ...","handlingStrategy":"validation","validationCode":"const seconds = Number(process.env.CODEX_TIMEOUT_S ?? 60);\nif (!Number.isInteger(seconds) || seconds < 10 || seconds > 120) {\n  throw new Error('CODEX_TIMEOUT_S must be an integer 10-120');\n}","typeGuard":"const isValidTimeout = (v) => Number.isInteger(Number(v)) && Number(v) >= 10 && Number(v) <= 120;","tryCatchPattern":"try {\n  run(['--timeout-seconds', String(seconds)]);\n} catch (e) {\n  if (String(e.message).includes('--timeout-seconds must be')) {\n    console.error('Use an integer between 10 and 120 seconds.');\n  }\n}","preventionTips":["Clamp user/config timeout values to [10, 120] before passing the flag.","Convert any millisecond values to seconds at the boundary.","Never build the flag from a possibly-empty shell variable without a default."],"tags":["cli","validation","timeout"],"backgroundTag":"value-out-of-range","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}