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

No mission task found for --task ${parsed.taskId}.

Error message

No mission task found for --task ${parsed.taskId}.

What it means

During mission mark, no task in the loaded summary has an id equal to the provided --task value. The summary is searched with tasks.find(candidate => candidate.id === parsed.taskId).

Source

Thrown at src/cli/mission.ts:381

  const now = options.now ?? (() => new Date());
  const stdout = options.stdout ?? ((line: string) => console.log(line));
  const stderr = options.stderr ?? ((line: string) => console.error(line));

  try {
    const parsed = parseMissionArgs(args);
    const paths = resolveMissionPaths(cwd, parsed);

    if (parsed.action === "status") {
      const summary = await readSummary(paths.summaryPath);
      syncSummary(summary, { status: missionStatus(summary.tasks) });
      printStatus(summary, paths.summaryPath, parsed.json, stdout);
      return;
    }

    if (parsed.action === "mark") {
      const summary = await readSummary(paths.summaryPath);
      const task = summary.tasks.find((candidate) => candidate.id === parsed.taskId);
      if (!task) throw new MissionCommandError(`No mission task found for --task ${parsed.taskId}.`);
      task.status = parsed.markStatus ?? task.status;
      task.completed_at = now().toISOString();
      delete task.exit_code;
      syncSummary(summary, { status: missionStatus(summary.tasks) });
      await persistSummary(paths.summaryPath, summary);
      await appendLedger(paths.ledgerPath, { event: "task_marked", at: task.completed_at, slug: summary.slug, task_id: task.id, status: task.status });
      if (parsed.json) stdout(JSON.stringify({ ok: true, summary_path: paths.summaryPath, ledger_path: paths.ledgerPath, summary }, null, 2));
      else {
        stdout(`mission task marked ${task.status}: ${summary.slug} ${task.id}`);
        stdout(`summary: ${paths.summaryPath}`);
        stdout(`ledger: ${paths.ledgerPath}`);
      }
      return;
    }

    if (parsed.action === "resume" || parsed.action === "rerun") {
      const summary = await readSummary(paths.summaryPath);
      const runTask = options.runTask;

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Run `mission status <file> --json` and copy the exact task id
  2. Re-run status to confirm the current task list before marking
  3. Check for whitespace or case differences in the id

Example fix

# before
mission mark mission.md --task task-01 --status blocked
# after (id confirmed via status --json)
mission mark mission.md --task task-1 --status blocked
Defensive patterns

Strategy: validation

Validate before calling

const summary = JSON.parse(await readFile(summaryPath, 'utf-8'));
if (!summary.tasks.some(t => t.id === taskId)) failEarly('unknown task id');

Prevention

When it happens

Trigger: Typo in the task id; task ids from a different mission's summary; the mission was re-run and task ids changed.

Common situations: Copy-pasting ids from an older status output; case/whitespace mismatches in ids; referencing a task after the mission file was edited and re-run.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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