{"record":{"id":"b4fe1342fb65342a","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-value-after-flag","errorCode":null,"errorMessage":"Missing value after ${flag}","messagePattern":"Missing value after (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/imagegen/continuation.ts","lineNumber":164,"sourceCode":"  const [subcommand, sessionIdRaw, ...rest] = args;\n  if (subcommand !== \"continuation\" && subcommand !== \"prepare\") {\n    throw new Error(IMAGEGEN_CONTINUATION_USAGE);\n  }\n  const sessionId = normalizeSessionId(sessionIdRaw ?? \"\");\n\n  let artifactName = \"\";\n  let generatedImagesDir: string | undefined;\n  let workDir: string | undefined;\n  let after: string | undefined;\n  let resumeInstruction: string | undefined;\n  let actor: string | undefined;\n  let json = false;\n\n  for (let i = 0; i < rest.length; i += 1) {\n    const arg = rest[i]!;\n    const readValue = (flag: string): string => {\n      const value = rest[i + 1];\n      if (!value) throw new Error(`Missing value after ${flag}`);\n      i += 1;\n      return value;\n    };\n\n    if (arg === \"--json\") {\n      json = true;\n    } else if (arg === \"--artifact\" || arg === \"--artifact-name\") {\n      artifactName = readValue(arg);\n    } else if (arg.startsWith(\"--artifact=\")) {\n      artifactName = arg.slice(\"--artifact=\".length);\n    } else if (arg.startsWith(\"--artifact-name=\")) {\n      artifactName = arg.slice(\"--artifact-name=\".length);\n    } else if (arg === \"--generated-dir\" || arg === \"--generated-images-dir\") {\n      generatedImagesDir = readValue(arg);\n    } else if (arg.startsWith(\"--generated-dir=\")) {\n      generatedImagesDir = arg.slice(\"--generated-dir=\".length);\n    } else if (arg.startsWith(\"--generated-images-dir=\")) {\n      generatedImagesDir = arg.slice(\"--generated-images-dir=\".length);","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/imagegen/continuation.ts#L146-L182","documentation":"While parsing imagegen continuation flags, a flag expecting a value (--artifact, --actor, etc.) was the last argument, so readValue found no following token. The error names the flag missing its value.","triggerScenarios":"An args array ending in a value-taking flag, e.g. ['continuation','s1','--artifact'] or ['prepare','s1','--actor'] with nothing after.","commonSituations":"Truncated command lines, shell splitting on unquoted spaces dropping a value, or scripted invocation where a variable expanded to empty and the flag was left dangling.","solutions":["Supply the value after the flag: --artifact name.png","Use the --flag=value form so the value is part of one token","Check that shell variables in the command are set and quoted"],"exampleFix":"// before\n[\"continuation\",\"s1\",\"--artifact\"]\n// after\n[\"continuation\",\"s1\",\"--artifact=name.png\"]","handlingStrategy":"validation","validationCode":"const VALUE_FLAGS = new Set(['--artifact','--actor','--generated-images-dir','--work-dir','--prompt-file']);\nfor (let i=0;i<args.length;i++){ if (VALUE_FLAGS.has(args[i]) && !args[i+1]) throw new Error(`dangling ${args[i]}`); }","typeGuard":null,"tryCatchPattern":"catch (e) { if ((e as Error).message.startsWith('Missing value after')) { /* append the value or use --flag=value */ } }","preventionTips":["Prefer --flag=value form","Quote shell variables","Assert even-length token pairs for value flags"],"tags":["cli","imagegen","argument-parsing"],"backgroundTag":"missing-flag-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}