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

Missing --task.

Error message

Missing --task.

What it means

Thrown by the `autopilot start` subcommand when no task text was supplied. The start command requires a task, given either via the --task flag or as a positional argument.

Source

Thrown at src/cli/autopilot.ts:113

  return `Autopilot phase ${String(state.current_phase ?? 'unknown')} has no child-stage instruction.`;
}

export async function autopilotCommand(args: string[], deps: AutopilotCommandDependencies = {}): Promise<void> {
  const stdout = deps.stdout ?? ((line: string) => console.log(line));
  const cwd = (deps.cwd ?? process.cwd)();
  const command = args[0] ?? 'help';
  const rest = args.slice(1);
  const sessionId = value(rest, '--session');
  const json = rest.includes('--json');

  if (command === 'help' || command === '--help' || command === '-h') {
    stdout(AUTOPILOT_HELP);
    return;
  }

  if (command === 'start') {
    const task = value(rest, '--task') ?? positionalTask(rest);
    if (!task) throw new Error('Missing --task.');
    const state = await startMode('autopilot', task, 3, cwd, sessionId);
    const initialized = await updateAutopilotPipelineState({
      ...state,
      active: true,
      current_phase: 'deep-interview',
      session_id: sessionId,
      workingDirectory: cwd,
      phase_cycle: ['deep-interview', 'ralplan', 'ultragoal'],
      handoff_artifacts: {},
      deep_interview_gate: { status: 'required' },
      review_cycle: 0,
    }, cwd, sessionId);
    if (json) stdout(JSON.stringify({ ok: true, state: initialized, instruction: instruction(initialized) }));
    else stdout(instruction(initialized));
    return;
  }

  const state = await readAutopilot(cwd, sessionId);

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Run `omx autopilot start --task "<your task description>"`
  2. Alternatively pass the task positionally: `omx autopilot start fix-the-login-bug`
  3. If scripting, quote the task and ensure the variable is non-empty before invoking

Example fix

// before
omx autopilot start
// after
omx autopilot start --task "Refactor auth module"
Defensive patterns

Strategy: validation

Validate before calling

const task = process.argv.task;
if (!task || !task.trim()) throw new UserError('Provide --task "<description>"');

Try / catch

try { await autopilotCommand(argv); } catch (e) { if (e.message === 'Missing --task.') printUsage('--task required'); else throw e; }

Prevention

When it happens

Trigger: Running `omx autopilot start` with neither --task <text> nor a trailing positional task string; or passing --task with no value such that value() returns undefined and positionalTask() also finds nothing.

Common situations: Forgetting the task flag, passing --task="" (empty string is falsy), or a wrapper script that drops the task argument when it contains spaces or is empty.

Related errors


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