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

Unknown imagegen continuation argument: ${arg}

Error message

Unknown imagegen continuation argument: ${arg}

What it means

The imagegen continuation arg parser hit an argument that matched none of its known flags, so it rejects the whole invocation naming the unknown token. This prevents silently ignored options.

Source

Thrown at src/imagegen/continuation.ts:208

      after = arg.slice("--after=".length);
    } else if (arg === "--resume-instruction" || arg === "--prompt") {
      resumeInstruction = readValue(arg);
    } else if (arg.startsWith("--resume-instruction=")) {
      resumeInstruction = arg.slice("--resume-instruction=".length);
    } else if (arg.startsWith("--prompt=")) {
      resumeInstruction = arg.slice("--prompt=".length);
    } else if (arg === "--resume-instruction-file" || arg === "--prompt-file") {
      resumeInstruction = readFileForCli(readValue(arg));
    } else if (arg.startsWith("--resume-instruction-file=")) {
      resumeInstruction = readFileForCli(arg.slice("--resume-instruction-file=".length));
    } else if (arg.startsWith("--prompt-file=")) {
      resumeInstruction = readFileForCli(arg.slice("--prompt-file=".length));
    } else if (arg === "--actor") {
      actor = readValue(arg);
    } else if (arg.startsWith("--actor=")) {
      actor = arg.slice("--actor=".length);
    } else {
      throw new Error(`Unknown imagegen continuation argument: ${arg}`);
    }
  }

  return {
    sessionId,
    artifactName: normalizeRequired(artifactName, "--artifact"),
    generatedImagesDir,
    workDir,
    after,
    resumeInstruction,
    actor,
    json,
  };
}

export const IMAGEGEN_CONTINUATION_USAGE = [
  "Usage:",
  "  omx imagegen continuation <session-id> --artifact <name> [--generated-dir <path>] [--work-dir <path>] [--after <iso|now>] [--prompt <text>|--prompt-file <path>] [--json]",

View on GitHub (pinned to 3ad79a8a6f)

Solutions

  1. Remove the unsupported flag or replace it with a supported one (--json, --artifact, --actor, --prompt-file, ...)
  2. Check the usage text for supported flags in this version
  3. Update the CLI if the flag exists in a newer release

Example fix

// before
["continuation","s1","--verbose"]
// after
["continuation","s1","--json"]
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN = new Set(['--json','--artifact','--generated-images-dir','--work-dir','--prompt-file','--prompt','--actor']);
const bad = args.filter(a => a.startsWith('--') && !KNOWN.has(a) && ![...KNOWN].some(k => a.startsWith(k+'=')));
if (bad.length) throw new Error(`unsupported flags: ${bad.join(',')}`);

Type guard

function isKnownFlag(a: string): boolean { return a.startsWith('--') && (KNOWN.has(a) || [...KNOWN].some(k => a.startsWith(k+'='))); }

Try / catch

catch (e) { if ((e as Error).message.startsWith('Unknown imagegen continuation argument')) { /* surface usage to user */ } }

Prevention

When it happens

Trigger: Passing a flag like --verbose, --dry-run, or a misspelled --artifacts to parseImagegenContinuationArgs; also bare positional extras after the session id.

Common situations: Using flags from a different tool version, typos, or copy-pasting commands from docs for another subcommand.

Related errors


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