Yeachan-Heo/oh-my-codex · error · AutoresearchGoalError
Missing --slug.
Error message
Missing --slug.
What it means
The autoresearch-goal handoff/start subcommand requires --slug to identify which goal to build a handoff for. Thrown when readValue(rest, '--slug') returns undefined.
Source
Thrown at src/cli/autoresearch-goal.ts:117
topic: topic ?? '',
rubric: rubric ?? '',
slug: readValue(rest, '--slug'),
criticCommand: readValue(rest, '--critic-command'),
force: hasFlag(rest, '--force'),
});
if (json) printJson({ ok: true, mission });
else {
console.log(`autoresearch-goal created: ${mission.slug}`);
console.log(`mission: ${mission.mission_path}`);
console.log(`rubric: ${mission.rubric_path}`);
console.log(`ledger: ${mission.ledger_path}`);
}
return;
}
if (command === 'handoff' || command === 'start') {
const slug = readValue(rest, '--slug');
if (!slug) throw new AutoresearchGoalError('Missing --slug.');
const instruction = await buildAutoresearchGoalHandoff(cwd, slug);
if (json) printJson({ ok: true, instruction });
else console.log(instruction);
return;
}
if (command === 'verdict' || command === 'checkpoint') {
const slug = readValue(rest, '--slug');
if (!slug) throw new AutoresearchGoalError('Missing --slug.');
const result = await recordAutoresearchGoalVerdict(cwd, {
slug,
verdict: parseVerdict(readValue(rest, '--verdict')),
evidence: readValue(rest, '--evidence') ?? '',
summary: readValue(rest, '--summary'),
artifactPath: readValue(rest, '--artifact'),
});
if (json) printJson({ ok: true, ...result });
else console.log(`autoresearch-goal verdict: ${result.mission.slug} -> ${result.completion.verdict}`);View on GitHub (pinned to 3ad79a8a6f)
Solutions
- Add --slug <goal-slug> identifying an existing autoresearch goal
- Confirm the slug matches a goal created earlier (check via the status subcommand)
- Use the --slug=value form for scripting safety
Example fix
// before omx autoresearch-goal handoff // after omx autoresearch-goal handoff --slug my-goal
Defensive patterns
Strategy: validation
Validate before calling
if (!args.some(a => a === '--slug' || a.startsWith('--slug=')) || !slugValue) {
throw new UsageError('handoff/start requires --slug');
} Type guard
const hasSlug = (a: string[]) => a.includes('--slug') || a.some(s => s.startsWith('--slug=')); Try / catch
try { await autoresearchGoalCommand(argv); } catch (e) { if (e instanceof AutoresearchGoalError && e.message === 'Missing --slug.') promptForSlug(); else throw e; } Prevention
- Keep a single source of truth for goal slugs in pipelines
- Assert required flags before invoking the CLI
When it happens
Trigger: Running `omx autoresearch-goal handoff` or `start` without --slug, or with --slug as the last token / followed by another flag (which raises error 108 instead).
Common situations: Forgetting the slug after copying a command template, or an empty slug variable in a pipeline script.
Related errors
- Usage: omx auth add <slot> [--device-auth|--with-api-key|--w
- Usage: omx auth use <slot>
- Missing --task.
- Missing --handoff-json.
- ${flag} requires a value
AI-assisted analysis of Yeachan-Heo/oh-my-codex@3ad79a8a6f (2026-08-27).
Data as JSON: /api/errors/918c57fd6a302c93.
Report an issue: GitHub.