Yeachan-Heo/oh-my-codex · error · MissionCommandError

--task is only supported for mission mark/rerun.

Error message

--task is only supported for mission mark/rerun.

What it means

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.

Source

Thrown at src/cli/mission.ts:233

      continue;
    }
    if (arg === "--status") {
      const value = readValue(commandArgs, index, arg);
      if (value !== "blocked" && value !== "needs-human-review") throw new MissionCommandError(`Unsupported mission mark status: ${value}`);
      markStatus = value;
      index += 1;
      continue;
    }
    if (arg.startsWith("--")) throw new MissionCommandError(`Unknown mission option: ${arg}`);
    if (!file) {
      file = arg;
      continue;
    }
    throw new MissionCommandError(`Unexpected mission argument: ${arg}`);
  }

  if (!file) throw new MissionCommandError(`Missing mission input file.\n\n${MISSION_HELP}`);
  if (action !== "rerun" && action !== "mark" && taskId) throw new MissionCommandError(`--task is only supported for mission mark/rerun.`);
  if (action === "rerun" && !taskId) throw new MissionCommandError(`mission rerun requires --task <id>.`);
  if (action !== "mark" && markStatus) throw new MissionCommandError(`--status is only supported for mission mark.`);
  if (action === "mark" && (!taskId || !markStatus)) throw new MissionCommandError(`mission mark requires --task <id> --status <blocked|needs-human-review>.`);
  return { action, file, dryRun, continueOnError, json, slug, summaryPath, taskId, markStatus, codexArgs };
}

function missionCounts(tasks: MissionTask[]): MissionSummary["counts"] {
  return {
    total: tasks.length,
    planned: tasks.filter((task) => task.status === "planned").length,
    passed: tasks.filter((task) => task.status === "passed").length,
    failed: tasks.filter((task) => task.status === "failed").length,
    skipped: tasks.filter((task) => task.status === "skipped").length,
    blocked: tasks.filter((task) => task.status === "blocked").length,
    "needs-human-review": tasks.filter((task) => task.status === "needs-human-review").length,
  };
}

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Remove --task for run/status/resume actions
  2. Use `mission rerun <file> --task <id>` to re-execute one task
  3. Use `mission mark <file> --task <id> --status ...` to update task status

Example fix

# before
mission run mission.md --task t1
# after
mission rerun mission.md --task t1
Defensive patterns

Strategy: validation

Validate before calling

const hasTask = args.includes('--task') || args.some(a => a.startsWith('--task='));
if (hasTask && action !== 'mark' && action !== 'rerun') failEarly();

Prevention

When it happens

Trigger: `mission run m.md --task t1` or `mission status m.md --task t1`.

Common situations: Assuming --task scopes a run to one task; migrating a mark/rerun invocation to another action but keeping the flag.

Related errors


AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27). Data as JSON: /api/errors/2c6d59337dde87cc. Report an issue: GitHub.