{"record":{"id":"f3d855a708cc2134","repo":"Yeachan-Heo/oh-my-codex","slug":"to-must-be-ralplan-or-ultragoal","errorCode":null,"errorMessage":"--to must be ralplan or ultragoal.","messagePattern":"--to must be ralplan or ultragoal\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/cli/autopilot.ts","lineNumber":145,"sourceCode":"    else stdout(instruction(initialized));\n    return;\n  }\n\n  const state = await readAutopilot(cwd, sessionId);\n  if (!state) throw new Error('No Autopilot state found. Run `omx autopilot start --task <text>` first.');\n\n  if (command === 'status' || command === 'next') {\n    const nextInstruction = instruction(state);\n    const skippedGates = skippedGateReport(state as unknown as Record<string, unknown>);\n    if (json) stdout(JSON.stringify({ state, instruction: nextInstruction }));\n    else if (command === 'next') stdout(nextInstruction);\n    else stdout([skippedGates ?? `autopilot: ${state.current_phase}`, nextInstruction].join('\\n'));\n    return;\n  }\n\n  if (command === 'advance') {\n    const to = value(rest, '--to');\n    if (to !== 'ralplan' && to !== 'ultragoal') throw new Error('--to must be ralplan or ultragoal.');\n    const rawHandoff = value(rest, '--handoff-json');\n    if (!rawHandoff) throw new Error('Missing --handoff-json.');\n    const handoff = await jsonInput(rawHandoff);\n    assertBoundHandoffIdentity(handoff, cwd, sessionId);\n    const updated = await updateAutopilotPipelineState({\n      ...handoff,\n      active: true,\n      current_phase: to,\n    }, cwd, sessionId);\n    if (json) stdout(JSON.stringify({ ok: true, state: updated, instruction: instruction(updated) }));\n    else stdout(instruction(updated));\n    return;\n  }\n\n  throw new Error(`Unknown autopilot command: ${command}\\n${AUTOPILOT_HELP}`);\n}\n","sourceCodeStart":127,"sourceCodeEnd":162,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/cli/autopilot.ts#L127-L162","documentation":"The `autopilot advance` command only supports transitioning to two named phases: ralplan and ultragoal. Any other --to value is rejected.","triggerScenarios":"Running `omx autopilot advance --to <x>` where x is not exactly 'ralplan' or 'ultragoal' — e.g. typos like 'ralplans', 'UltraGoal', 'plan', or an arbitrary phase name.","commonSituations":"Guessing phase names without reading the help text, case mismatches, or copied commands from outdated docs referring to renamed phases.","solutions":["Use exactly `--to ralplan` or `--to ultragoal` (lowercase)","Run `omx autopilot` with no args to print AUTOPILOT_HELP and confirm supported phase names","Check spelling/case — the comparison is strict string equality"],"exampleFix":"// before\nomx autopilot advance --to RalPlan --handoff-json h.json\n// after\nomx autopilot advance --to ralplan --handoff-json h.json","handlingStrategy":"validation","validationCode":"const PHASES = ['ralplan','ultragoal'] as const;\nif (!PHASES.includes(to)) throw new UsageError(`--to must be one of ${PHASES.join(', ')}`);","typeGuard":"const isPhase = (v: string): v is 'ralplan'|'ultragoal' => v==='ralplan'||v==='ultragoal';","tryCatchPattern":"try { await advance(to); } catch (e) { if (e.message.includes('--to must be')) printSupportedPhases(); else throw e; }","preventionTips":["Pin phase names as string-literal union types in wrapper code","Read AUTOPILOT_HELP after version upgrades"],"tags":["cli","invalid-argument","autopilot"],"backgroundTag":"invalid-enum-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}