{"record":{"id":"8a75163b6133b5ff","repo":"openai/codex-plugin-cc","slug":"choose-either-enable-review-gate-or-disable-re","errorCode":null,"errorMessage":"Choose either --enable-review-gate or --disable-review-gate.","messagePattern":"Choose either --enable-review-gate or --disable-review-gate\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"plugins/codex/scripts/codex-companion.mjs","lineNumber":222,"sourceCode":"    node: nodeStatus,\n    npm: npmStatus,\n    codex: codexStatus,\n    auth: authStatus,\n    sessionRuntime: getSessionRuntimeStatus(process.env, workspaceRoot),\n    reviewGateEnabled: Boolean(config.stopReviewGate),\n    actionsTaken,\n    nextSteps\n  };\n}\n\nasync function handleSetup(argv) {\n  const { options } = parseCommandInput(argv, {\n    valueOptions: [\"cwd\"],\n    booleanOptions: [\"json\", \"enable-review-gate\", \"disable-review-gate\"]\n  });\n\n  if (options[\"enable-review-gate\"] && options[\"disable-review-gate\"]) {\n    throw new Error(\"Choose either --enable-review-gate or --disable-review-gate.\");\n  }\n\n  const cwd = resolveCommandCwd(options);\n  const workspaceRoot = resolveCommandWorkspace(options);\n  const actionsTaken = [];\n\n  if (options[\"enable-review-gate\"]) {\n    setConfig(workspaceRoot, \"stopReviewGate\", true);\n    actionsTaken.push(`Enabled the stop-time review gate for ${workspaceRoot}.`);\n  } else if (options[\"disable-review-gate\"]) {\n    setConfig(workspaceRoot, \"stopReviewGate\", false);\n    actionsTaken.push(`Disabled the stop-time review gate for ${workspaceRoot}.`);\n  }\n\n  const finalReport = await buildSetupReport(cwd, actionsTaken);\n  outputResult(options.json ? finalReport : renderSetupReport(finalReport), options.json);\n}\n","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/openai/codex-plugin-cc/blob/db52e28f4d9ded852ab3942cea316258ae4ef346/plugins/codex/scripts/codex-companion.mjs#L204-L240","documentation":"handleSetup parses boolean options enable-review-gate and disable-review-gate. They are mutually exclusive because they write opposite values to the same config key (stopReviewGate). Throwing both would leave config in an ambiguous state, so the guard runs before any write.","triggerScenarios":"Running `/codex:setup --enable-review-gate --disable-review-gate` in a single invocation, often from a shell alias or automation that concatenates both.","commonSituations":"A config script that toggles based on a variable but always emits both flags, or a user trying to 'reset' by passing both.","solutions":["Pass only one of --enable-review-gate or --disable-review-gate.","Run setup with neither flag to just inspect status without changing the gate.","Fix the automation to pass exactly one based on the desired boolean."],"exampleFix":"// before\ncodex-companion.mjs setup --enable-review-gate --disable-review-gate\n// after\ncodex-companion.mjs setup --enable-review-gate","handlingStrategy":"validation","validationCode":"if (enableReviewGate && disableReviewGate) {\n  throw new Error('Pick one gate flag');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Derive the flag from a single boolean variable so both are never emitted.","Use a tri-state enum (enable|disable|noop) in wrappers."],"tags":["cli","validation","conflicting-flags","setup"],"backgroundTag":null,"analyzedSha":"db52e28f4d9ded852ab3942cea316258ae4ef346","analyzedAt":"2026-08-13T05:13:20.855Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}