{"record":{"id":"2c6d59337dde87cc","repo":"Yeachan-Heo/oh-my-codex","slug":"task-is-only-supported-for-mission-mark-rerun","errorCode":null,"errorMessage":"--task is only supported for mission mark/rerun.","messagePattern":"--task is only supported for mission mark/rerun\\.","errorType":"exception","errorClass":"MissionCommandError","httpStatus":null,"severity":"error","filePath":"src/cli/mission.ts","lineNumber":233,"sourceCode":"      continue;\n    }\n    if (arg === \"--status\") {\n      const value = readValue(commandArgs, index, arg);\n      if (value !== \"blocked\" && value !== \"needs-human-review\") throw new MissionCommandError(`Unsupported mission mark status: ${value}`);\n      markStatus = value;\n      index += 1;\n      continue;\n    }\n    if (arg.startsWith(\"--\")) throw new MissionCommandError(`Unknown mission option: ${arg}`);\n    if (!file) {\n      file = arg;\n      continue;\n    }\n    throw new MissionCommandError(`Unexpected mission argument: ${arg}`);\n  }\n\n  if (!file) throw new MissionCommandError(`Missing mission input file.\\n\\n${MISSION_HELP}`);\n  if (action !== \"rerun\" && action !== \"mark\" && taskId) throw new MissionCommandError(`--task is only supported for mission mark/rerun.`);\n  if (action === \"rerun\" && !taskId) throw new MissionCommandError(`mission rerun requires --task <id>.`);\n  if (action !== \"mark\" && markStatus) throw new MissionCommandError(`--status is only supported for mission mark.`);\n  if (action === \"mark\" && (!taskId || !markStatus)) throw new MissionCommandError(`mission mark requires --task <id> --status <blocked|needs-human-review>.`);\n  return { action, file, dryRun, continueOnError, json, slug, summaryPath, taskId, markStatus, codexArgs };\n}\n\nfunction missionCounts(tasks: MissionTask[]): MissionSummary[\"counts\"] {\n  return {\n    total: tasks.length,\n    planned: tasks.filter((task) => task.status === \"planned\").length,\n    passed: tasks.filter((task) => task.status === \"passed\").length,\n    failed: tasks.filter((task) => task.status === \"failed\").length,\n    skipped: tasks.filter((task) => task.status === \"skipped\").length,\n    blocked: tasks.filter((task) => task.status === \"blocked\").length,\n    \"needs-human-review\": tasks.filter((task) => task.status === \"needs-human-review\").length,\n  };\n}\n","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/mission.ts#L215-L251","documentation":"Post-parse validation: a --task <id> was supplied but the action is neither mark nor rerun. Only those two actions operate on a single task by id.","triggerScenarios":"`mission run m.md --task t1` or `mission status m.md --task t1`.","commonSituations":"Assuming --task scopes a run to one task; migrating a mark/rerun invocation to another action but keeping the flag.","solutions":["Remove --task for run/status/resume actions","Use `mission rerun <file> --task <id>` to re-execute one task","Use `mission mark <file> --task <id> --status ...` to update task status"],"exampleFix":"# before\nmission run mission.md --task t1\n# after\nmission rerun mission.md --task t1","handlingStrategy":"validation","validationCode":"const hasTask = args.includes('--task') || args.some(a => a.startsWith('--task='));\nif (hasTask && action !== 'mark' && action !== 'rerun') failEarly();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Model per-action flag policies in one place"],"tags":["cli","argument-validation","mission"],"backgroundTag":"invalid-cli-flag-combination","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}