Yeachan-Heo/oh-my-codex · error · MissionCommandError
--dry-run is only supported for mission run/plan.
Error message
--dry-run is only supported for mission run/plan.
What it means
Thrown by parseMissionArgs when the --dry-run flag is passed for a mission action other than run. Despite the message mentioning 'run/plan', the code only accepts action === 'run'. It is a CLI argument-validation error for the mission subcommand.
Source
Thrown at src/cli/mission.ts:171
}
const separator = rest.indexOf("--");
const commandArgs = separator >= 0 ? rest.slice(0, separator) : rest;
const codexArgs = separator >= 0 ? rest.slice(separator + 1) : [];
let file: string | undefined;
let dryRun = action === "plan";
let continueOnError = false;
let json = false;
let slug: string | undefined;
let summaryPath: string | undefined;
let taskId: string | undefined;
let markStatus: Extract<MissionTaskStatus, "blocked" | "needs-human-review"> | undefined;
for (let index = 0; index < commandArgs.length; index += 1) {
const arg = commandArgs[index] ?? "";
if (arg === "--dry-run") {
if (action !== "run") throw new MissionCommandError(`--dry-run is only supported for mission run/plan.`);
dryRun = true;
continue;
}
if (arg === "--continue-on-error") {
if (action === "status") throw new MissionCommandError(`--continue-on-error is not supported for mission status.`);
continueOnError = true;
continue;
}
if (arg === "--json") {
json = true;
continue;
}
if (arg.startsWith("--summary=")) {
summaryPath = arg.slice("--summary=".length);
continue;
}
if (arg === "--summary") {
summaryPath = readValue(commandArgs, index, arg);View on GitHub (pinned to 3ad79a8a6f)
Solutions
- Remove --dry-run from the command when the action is not run
- Use `mission run <file> --dry-run` for parser/plan validation
- For read-only inspection of an existing mission, use `mission status <file>` instead
Example fix
# before mission status mission.md --dry-run # after mission status mission.md
Defensive patterns
Strategy: validation
Validate before calling
const action = args[0];
if (args.includes('--dry-run') && action !== 'run') {
console.error('--dry-run only valid for mission run');
process.exit(2);
} Prevention
- Build CLI flag lists per action rather than sharing one global set
- Validate flag/action compatibility before dispatching to missionCommand
When it happens
Trigger: Running e.g. `mission status file.md --dry-run`, `mission mark file.md --task t1 --status blocked --dry-run`, or `mission resume file.md --dry-run` — any action besides run with --dry-run.
Common situations: Assuming dry-run applies to all subcommands (status/resume/rerun/mark); shell scripts that append --dry-run unconditionally to every mission invocation.
Related errors
- --continue-on-error is not supported for mission status.
- --task is only supported for mission mark/rerun.
- --status is only supported for mission mark.
- --keep-policy must be one of: score_improvement, pass_only
- Unknown capabilities subcommand: ${parsed.subcommand}
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/66633aa7c6d12e66.
Report an issue: GitHub.