{"record":{"id":"e3b6f6501a4ea766","repo":"Yeachan-Heo/oh-my-codex","slug":"missing-value-after-prompt","errorCode":null,"errorMessage":"Missing value after --prompt","messagePattern":"Missing value after --prompt","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/exec/followup.ts","lineNumber":376,"sourceCode":"  sessionId: string;\n  prompt: string;\n  actor?: string;\n  json: boolean;\n} {\n  const [, sessionIdRaw, ...rest] = args;\n  const sessionId = sessionIdRaw?.trim();\n  if (!sessionId) throw new Error(\"Usage: omx exec inject <session-id> --prompt <text> [--actor <name>] [--json]\");\n\n  let prompt = \"\";\n  let actor: string | undefined;\n  let json = false;\n  for (let i = 0; i < rest.length; i += 1) {\n    const arg = rest[i]!;\n    if (arg === \"--json\") {\n      json = true;\n    } else if (arg === \"--prompt\") {\n      const value = rest[i + 1];\n      if (!value) throw new Error(\"Missing value after --prompt\");\n      prompt = value;\n      i += 1;\n    } else if (arg.startsWith(\"--prompt=\")) {\n      prompt = arg.slice(\"--prompt=\".length);\n    } else if (arg === \"--prompt-file\") {\n      const value = rest[i + 1];\n      if (!value) throw new Error(\"Missing path after --prompt-file\");\n      prompt = readFileSyncForCli(value);\n      i += 1;\n    } else if (arg.startsWith(\"--prompt-file=\")) {\n      prompt = readFileSyncForCli(arg.slice(\"--prompt-file=\".length));\n    } else if (arg === \"--actor\") {\n      const value = rest[i + 1];\n      if (!value) throw new Error(\"Missing value after --actor\");\n      actor = value;\n      i += 1;\n    } else if (arg.startsWith(\"--actor=\")) {\n      actor = arg.slice(\"--actor=\".length);","sourceCodeStart":358,"sourceCodeEnd":394,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/exec/followup.ts#L358-L394","documentation":"Usage error from parseExecInjectArgs when `--prompt` is the last token of the command line, so there is no following value to consume. The parser reads rest[i+1] after seeing --prompt and throws when it is undefined.","triggerScenarios":"Ending the command with a bare `--prompt` (e.g. `omx exec inject <id> --prompt`); a shell variable that expands to empty making the next token disappear; line-continuation backslash mistakes that drop the value.","commonSituations":"Prompt text intended from an unset env var (`--prompt \"$MSG\"` where MSG is empty expands to a missing value in some shells/scripts); trailing flag typo; CI YAML folds the value onto a missing line; user edits a copied command and deletes the text.","solutions":["Supply the value inline: `--prompt \"<text>\"` or `--prompt=<text>`.","If the value comes from a variable, default or assert it first: `: \"${MSG:?MSG is required}\"`.","Use the --prompt= form to make the pairing explicit and resistant to token splitting.","For long prompts use --prompt-file <path> instead."],"exampleFix":"# before\nomx exec inject \"$SESSION_ID\" --prompt\n\n# after\nomx exec inject \"$SESSION_ID\" --prompt \"rerun the flaky suite\"","handlingStrategy":"validation","validationCode":"const args = ['--prompt'];\nif (!text) throw new Error('prompt text required');\nargs.push(text);","typeGuard":null,"tryCatchPattern":"catch (e) { if (e instanceof Error && e.message === 'Missing value after --prompt') { console.error('provide --prompt <text> or --prompt=<text>'); process.exit(2); } throw e; }","preventionTips":["Prefer the --prompt=value form in scripts.","Assert prompt variables are non-empty before building the command line."],"tags":["cli","usage-error","argument-parsing","missing-value"],"backgroundTag":"missing-cli-option-value","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}