{"record":{"id":"796dc4d8efae6c54","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-required-name","errorCode":null,"errorMessage":"Missing required ${name}","messagePattern":"Missing required (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/imagegen/continuation.ts","lineNumber":59,"sourceCode":"  artifactName: string;\n  generatedImagesDir?: string;\n  workDir?: string;\n  after?: string;\n  resumeInstruction?: string;\n  actor?: string;\n  json: boolean;\n}\n\nconst DEFAULT_ACTOR = \"omx-imagegen\";\nconst SESSION_ID_PATTERN = /^[A-Za-z0-9_-]{1,128}$/;\n\nfunction sessionImagegenPendingPath(cwd: string, sessionId: string): string {\n  return join(cwd, \".omx\", \"state\", \"sessions\", sessionId, \"imagegen-pending.json\");\n}\n\nfunction normalizeRequired(value: string | undefined, name: string): string {\n  const normalized = value?.trim() ?? \"\";\n  if (!normalized) throw new Error(`Missing required ${name}`);\n  return normalized;\n}\n\nfunction normalizeSessionId(sessionId: string): string {\n  const normalized = normalizeRequired(sessionId, \"session id\");\n  if (!SESSION_ID_PATTERN.test(normalized)) {\n    throw new Error(\"Invalid session id. Expected 1-128 alphanumeric, underscore, or dash characters.\");\n  }\n  return normalized;\n}\n\nfunction normalizeIsoOrNow(value: string | undefined, nowIso: string): string {\n  const normalized = value?.trim();\n  if (!normalized || normalized.toLowerCase() === \"now\") return nowIso;\n  const parsed = Date.parse(normalized);\n  if (!Number.isFinite(parsed)) {\n    throw new Error(`Invalid --after timestamp: ${value}`);\n  }","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/imagegen/continuation.ts#L41-L77","documentation":"A required string argument (e.g. session id or --artifact value) was missing or blank after trimming in the imagegen continuation CLI argument parser. normalizeRequired is used by the arg parser for values that must be present, so an omitted or whitespace-only value produces this error naming the missing field.","triggerScenarios":"Calling parseImagegenContinuationArgs where the --artifact value (or session id) is absent, empty, or only whitespace. The error message interpolates the field name, e.g. 'Missing required session id' or 'Missing required --artifact'.","commonSituations":"Invoking the imagegen continuation subcommand without --artifact, passing --artifact= with no value, or a script dropping an argument mid-pipeline.","solutions":["Supply the required flag with a non-empty value (e.g. --artifact <name>)","Check for empty-string expansions in shell scripts ($ARTIFACT unset)","Trim/validate arguments in the calling script before invoking the CLI"],"exampleFix":"// before\nomx imagegen continuation prepare sess1\n// after\nomx imagegen continuation prepare sess1 --artifact hero.png","handlingStrategy":"validation","validationCode":"if (!String(artifact).trim()) throw new Error('artifact required before calling CLI');","typeGuard":"function isNonEmptyString(v: unknown): v is string { return typeof v === 'string' && v.trim().length > 0; }","tryCatchPattern":"catch (e) { if ((e as Error).message.startsWith('Missing required')) { /* prompt user / fill default */ } }","preventionTips":["Validate required args before invoking the parser","Set defaults in wrapper scripts","Fail fast on empty environment variables"],"tags":["cli","imagegen","argument-validation"],"backgroundTag":"missing-required-argument","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}