openai/codex-plugin-cc · error · Error
Choose either --enable-review-gate or --disable-review-gate.
Error message
Choose either --enable-review-gate or --disable-review-gate.
What it means
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.
Source
Thrown at plugins/codex/scripts/codex-companion.mjs:222
node: nodeStatus,
npm: npmStatus,
codex: codexStatus,
auth: authStatus,
sessionRuntime: getSessionRuntimeStatus(process.env, workspaceRoot),
reviewGateEnabled: Boolean(config.stopReviewGate),
actionsTaken,
nextSteps
};
}
async function handleSetup(argv) {
const { options } = parseCommandInput(argv, {
valueOptions: ["cwd"],
booleanOptions: ["json", "enable-review-gate", "disable-review-gate"]
});
if (options["enable-review-gate"] && options["disable-review-gate"]) {
throw new Error("Choose either --enable-review-gate or --disable-review-gate.");
}
const cwd = resolveCommandCwd(options);
const workspaceRoot = resolveCommandWorkspace(options);
const actionsTaken = [];
if (options["enable-review-gate"]) {
setConfig(workspaceRoot, "stopReviewGate", true);
actionsTaken.push(`Enabled the stop-time review gate for ${workspaceRoot}.`);
} else if (options["disable-review-gate"]) {
setConfig(workspaceRoot, "stopReviewGate", false);
actionsTaken.push(`Disabled the stop-time review gate for ${workspaceRoot}.`);
}
const finalReport = await buildSetupReport(cwd, actionsTaken);
outputResult(options.json ? finalReport : renderSetupReport(finalReport), options.json);
}
View on GitHub (pinned to db52e28f4d)
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.
Example fix
// before codex-companion.mjs setup --enable-review-gate --disable-review-gate // after codex-companion.mjs setup --enable-review-gate
Defensive patterns
Strategy: validation
Validate before calling
if (enableReviewGate && disableReviewGate) {
throw new Error('Pick one gate flag');
} Prevention
- Derive the flag from a single boolean variable so both are never emitted.
- Use a tri-state enum (enable|disable|noop) in wrappers.
When it happens
Trigger: Running `/codex:setup --enable-review-gate --disable-review-gate` in a single invocation, often from a shell alias or automation that concatenates both.
Common situations: A config script that toggles based on a variable but always emits both flags, or a user trying to 'reset' by passing both.
Related errors
- Choose either --resume/--resume-last or --fresh.
- Unsupported reasoning effort "${effort}". Use one of: none,
- This `/codex:review` target is not supported by the built-in
- Provide a prompt, a prompt file, piped stdin, or use --resum
- Missing required --job-id for task-worker.
AI-assisted analysis of openai/codex-plugin-cc@db52e28f4d (2026-08-13).
Data as JSON: /api/errors/8a75163b6133b5ff.
Report an issue: GitHub.