{"record":{"id":"6be28bbe740427ff","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-task","errorCode":null,"errorMessage":"Missing --task.","messagePattern":"Missing --task\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/autopilot.ts","lineNumber":113,"sourceCode":"  return `Autopilot phase ${String(state.current_phase ?? 'unknown')} has no child-stage instruction.`;\n}\n\nexport async function autopilotCommand(args: string[], deps: AutopilotCommandDependencies = {}): Promise<void> {\n  const stdout = deps.stdout ?? ((line: string) => console.log(line));\n  const cwd = (deps.cwd ?? process.cwd)();\n  const command = args[0] ?? 'help';\n  const rest = args.slice(1);\n  const sessionId = value(rest, '--session');\n  const json = rest.includes('--json');\n\n  if (command === 'help' || command === '--help' || command === '-h') {\n    stdout(AUTOPILOT_HELP);\n    return;\n  }\n\n  if (command === 'start') {\n    const task = value(rest, '--task') ?? positionalTask(rest);\n    if (!task) throw new Error('Missing --task.');\n    const state = await startMode('autopilot', task, 3, cwd, sessionId);\n    const initialized = await updateAutopilotPipelineState({\n      ...state,\n      active: true,\n      current_phase: 'deep-interview',\n      session_id: sessionId,\n      workingDirectory: cwd,\n      phase_cycle: ['deep-interview', 'ralplan', 'ultragoal'],\n      handoff_artifacts: {},\n      deep_interview_gate: { status: 'required' },\n      review_cycle: 0,\n    }, cwd, sessionId);\n    if (json) stdout(JSON.stringify({ ok: true, state: initialized, instruction: instruction(initialized) }));\n    else stdout(instruction(initialized));\n    return;\n  }\n\n  const state = await readAutopilot(cwd, sessionId);","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/autopilot.ts#L95-L131","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Run `omx autopilot start --task \"<your task description>\"`","Alternatively pass the task positionally: `omx autopilot start fix-the-login-bug`","If scripting, quote the task and ensure the variable is non-empty before invoking"],"exampleFix":"// before\nomx autopilot start\n// after\nomx autopilot start --task \"Refactor auth module\"","handlingStrategy":"validation","validationCode":"const task = process.argv.task;\nif (!task || !task.trim()) throw new UserError('Provide --task \"<description>\"');","typeGuard":null,"tryCatchPattern":"try { await autopilotCommand(argv); } catch (e) { if (e.message === 'Missing --task.') printUsage('--task required'); else throw e; }","preventionTips":["Wrap the CLI in a script that asserts the task variable is non-empty","Use quoted task strings"],"tags":["cli","missing-argument","autopilot"],"backgroundTag":"missing-required-flag","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}