{"record":{"id":"66633aa7c6d12e66","repo":"Yeachan-Heo/oh-my-codex","slug":"dry-run-is-only-supported-for-mission-run-plan","errorCode":null,"errorMessage":"--dry-run is only supported for mission run/plan.","messagePattern":"--dry-run is only supported for mission run/plan\\.","errorType":"exception","errorClass":"MissionCommandError","httpStatus":null,"severity":"error","filePath":"src/cli/mission.ts","lineNumber":171,"sourceCode":"  }\n\n  const separator = rest.indexOf(\"--\");\n  const commandArgs = separator >= 0 ? rest.slice(0, separator) : rest;\n  const codexArgs = separator >= 0 ? rest.slice(separator + 1) : [];\n\n  let file: string | undefined;\n  let dryRun = action === \"plan\";\n  let continueOnError = false;\n  let json = false;\n  let slug: string | undefined;\n  let summaryPath: string | undefined;\n  let taskId: string | undefined;\n  let markStatus: Extract<MissionTaskStatus, \"blocked\" | \"needs-human-review\"> | undefined;\n\n  for (let index = 0; index < commandArgs.length; index += 1) {\n    const arg = commandArgs[index] ?? \"\";\n    if (arg === \"--dry-run\") {\n      if (action !== \"run\") throw new MissionCommandError(`--dry-run is only supported for mission run/plan.`);\n      dryRun = true;\n      continue;\n    }\n    if (arg === \"--continue-on-error\") {\n      if (action === \"status\") throw new MissionCommandError(`--continue-on-error is not supported for mission status.`);\n      continueOnError = true;\n      continue;\n    }\n    if (arg === \"--json\") {\n      json = true;\n      continue;\n    }\n    if (arg.startsWith(\"--summary=\")) {\n      summaryPath = arg.slice(\"--summary=\".length);\n      continue;\n    }\n    if (arg === \"--summary\") {\n      summaryPath = readValue(commandArgs, index, arg);","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/mission.ts#L153-L189","documentation":"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.","triggerScenarios":"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.","commonSituations":"Assuming dry-run applies to all subcommands (status/resume/rerun/mark); shell scripts that append --dry-run unconditionally to every mission invocation.","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"],"exampleFix":"# before\nmission status mission.md --dry-run\n# after\nmission status mission.md","handlingStrategy":"validation","validationCode":"const action = args[0];\nif (args.includes('--dry-run') && action !== 'run') {\n  console.error('--dry-run only valid for mission run');\nprocess.exit(2);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build CLI flag lists per action rather than sharing one global set","Validate flag/action compatibility before dispatching to missionCommand"],"tags":["cli","argument-validation","mission"],"backgroundTag":"invalid-cli-flag","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}