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

Missing or invalid --verdict; expected pass, fail, or blocke

Error message

Missing or invalid --verdict; expected pass, fail, or blocked.

What it means

parseVerdict() only accepts exactly one of the strings pass, fail, or blocked. Any other value (or a missing --verdict) throws this AutoresearchGoalError during the verdict/checkpoint subcommand.

Source

Thrown at src/cli/autoresearch-goal.ts:80

function positionalText(args: readonly string[]): string {
  const valueTaking = new Set(['--topic', '--rubric', '--critic-command', '--slug', '--verdict', '--evidence', '--summary', '--artifact', '--codex-goal-json']);
  const words: string[] = [];
  for (let i = 0; i < args.length; i++) {
    const arg = args[i];
    if (valueTaking.has(arg)) { i += 1; continue; }
    if (arg.startsWith('--')) continue;
    words.push(arg);
  }
  return words.join(' ').trim();
}

function printJson(value: unknown): void {
  console.log(JSON.stringify(value, null, 2));
}

function parseVerdict(value: string | undefined): AutoresearchGoalVerdict {
  if (value === 'pass' || value === 'fail' || value === 'blocked') return value;
  throw new AutoresearchGoalError('Missing or invalid --verdict; expected pass, fail, or blocked.');
}

export async function autoresearchGoalCommand(args: string[]): Promise<void> {
  const command = args[0] ?? 'help';
  const rest = args.slice(1);
  const json = hasFlag(rest, '--json');
  const cwd = process.cwd();

  try {
    if (command === 'help' || command === '--help' || command === '-h') {
      console.log(AUTORESEARCH_GOAL_HELP);
      return;
    }

    if (command === 'create' || command === 'init') {
      const topic = readValue(rest, '--topic') ?? positionalText(rest);
      const rubric = await readMaybeFile(readValue(rest, '--rubric'));
      const mission = await createAutoresearchGoal(cwd, {

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Use exactly one of: --verdict pass, --verdict fail, --verdict blocked (lowercase)
  2. If the verdict is missing, decide the outcome first — the command is meaningless without it
  3. Prefer the --verdict=pass inline form to avoid flag-value parsing issues

Example fix

// before
omx autoresearch-goal verdict --slug g1 --verdict passed
// after
omx autoresearch-goal verdict --slug g1 --verdict pass
Defensive patterns

Strategy: validation

Validate before calling

const VERDICTS = ['pass','fail','blocked'] as const;
const v = argv.verdict;
if (!VERDICTS.includes(v)) throw new UsageError(`--verdict must be one of ${VERDICTS.join('|')}`);

Type guard

const isVerdict = (v: unknown): v is 'pass'|'fail'|'blocked' => v==='pass'||v==='fail'||v==='blocked';

Try / catch

try { await verdict(...); } catch (e) { if (e.message.includes('--verdict')) printVerdictUsage(); else throw e; }

Prevention

When it happens

Trigger: Calling `omx autoresearch-goal verdict --slug X --verdict <v>` where v is not exactly 'pass'/'fail'/'blocked' — e.g. 'passed', 'ok', 'PASS' (case-sensitive), or omitting --verdict (readValue returns undefined). Also triggered when --verdict's value slot is a following flag, though that raises error 108 first.

Common situations: Writing 'passed' instead of 'pass', capitalized verdicts from UI labels, or forgetting the verdict flag entirely when recording a checkpoint.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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