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

Unknown mission option: ${arg}

Error message

Unknown mission option: ${arg}

What it means

Generic unknown-option error: any argument starting with -- that doesn't match a known mission option reaches this throw. Note codex passthrough args must be provided via the designated mechanism, not as raw -- flags.

Source

Thrown at src/cli/mission.ts:224

    if (arg === "--task") {
      taskId = readValue(commandArgs, index, arg);
      index += 1;
      continue;
    }
    if (arg.startsWith("--status=")) {
      const value = arg.slice("--status=".length);
      if (value !== "blocked" && value !== "needs-human-review") throw new MissionCommandError(`Unsupported mission mark status: ${value}`);
      markStatus = value;
      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,

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Check the flag spelling against MISSION_HELP
  2. Remove unsupported flags
  3. Pass runner-specific args through the documented codex-args mechanism rather than raw -- flags

Example fix

# before
mission run mission.md --dryrun
# after
mission run mission.md --dry-run
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN = new Set(['--dry-run','--continue-on-error','--json','--task','--status','--slug','--summary','--codex']);
const unknown = args.filter(a => a.startsWith('--') && !KNOWN.has(a.split('=')[0]));
if (unknown.length) failEarly(unknown);

Prevention

When it happens

Trigger: `mission run m.md --verbose`, `--force`, or a mistyped flag like `--jsno` instead of --json.

Common situations: Typos in flags; assuming options from other subcommands (e.g. --task on run) exist; trying to pass codex flags directly without the passthrough syntax.

Related errors


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