{"record":{"id":"4ad6aa273cccc76a","repo":"Yeachan-Heo/oh-my-codex","slug":"invalid-after-timestamp-value","errorCode":null,"errorMessage":"Invalid --after timestamp: ${value}","messagePattern":"Invalid --after timestamp: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/imagegen/continuation.ts","lineNumber":76,"sourceCode":"  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  }\n  return new Date(parsed).toISOString();\n}\n\nfunction defaultResumeInstruction(\n  record: Omit<ImagegenContinuationRecord, \"resume_instruction\">,\n  pendingPath: string,\n): string {\n  const generatedDir = record.generated_images_dir || \"$CODEX_HOME/generated_images/<session>\";\n  const workDir = record.work_dir || \".omx imagegen artifact workspace\";\n  return [\n    `Resume the interrupted Ralph visual/imagegen workflow for artifact \"${record.artifact_name}\".`,\n    `Read pending imagegen metadata at ${pendingPath} if needed.`,\n    `Locate the newest generated image in ${generatedDir} created after ${record.after}.`,\n    `Copy it into ${workDir}, preserve the raw artifact, then run the required crop/post-process and visual QA/visual-verdict gate before any next edit.`,\n    \"Update Ralph progress/checkpoint state with fresh verification evidence, then continue the workflow instead of stopping solely because image generation completed.\",\n  ].join(\"\\n\");\n}","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/imagegen/continuation.ts#L58-L94","documentation":"The --after flag for imagegen continuation accepts an ISO timestamp or the literal 'now'; any value Date.parse cannot resolve throws this error echoing the bad input. This guards downstream resume logic from unparseable timestamps.","triggerScenarios":"Passing --after with a non-date string such as 'yesterday', '2024-13-45', or a locale-formatted date that Date.parse rejects (e.g. '12/31/2024 3pm').","commonSituations":"Shell-quoting mistakes, locale-specific date formats, relative date words, or a variable that was never set producing garbage.","solutions":["Use ISO 8601 format (2024-08-27T12:00:00Z) or the literal 'now'","Validate the timestamp in the caller with Date.parse before passing it","Quote the argument to prevent shell mangling"],"exampleFix":"// before\n--after \"12/31/2024 3pm\"\n// after\n--after 2024-12-31T15:00:00.000Z","handlingStrategy":"validation","validationCode":"if (after !== 'now' && !Number.isFinite(Date.parse(after))) throw new Error('bad --after'); // fix before calling","typeGuard":"function isIsoOrNow(v: string): boolean { return v === 'now' || Number.isFinite(Date.parse(v)); }","tryCatchPattern":null,"preventionTips":["Always emit ISO 8601 UTC timestamps from callers","Centralize date formatting in one helper","Never pass locale-formatted dates across CLI boundaries"],"tags":["cli","imagegen","timestamp","date-parsing"],"backgroundTag":"invalid-timestamp-format","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}