tinyhumansai/openhuman · error · Error
${name} requires a value
Error message
${name} requires a value What it means
In generate-release-notes.mjs option parsing, every value-taking option (--from, --to, --repo, --model, --output/-o) reads its value via readValue(): the next argv token must exist and must not start with '--'. A missing value — the option is last, or is immediately followed by another flag — throws `${name} requires a value` naming the option.
Source
Thrown at scripts/release/generate-release-notes.mjs:61
argv = argv.slice(1);
}
const options = {
from: process.env.RELEASE_NOTES_FROM || DEFAULT_FROM,
to: process.env.RELEASE_NOTES_TO || DEFAULT_TO,
repo: process.env.GITHUB_REPOSITORY || null,
model: process.env.OPENAI_MODEL || DEFAULT_MODEL,
output: null,
noAi: false,
dryRun: false,
};
for (let index = 0; index < argv.length; index += 1) {
const arg = argv[index];
const readValue = (name) => {
const value = argv[index + 1];
if (!value || value.startsWith('--')) {
throw new Error(`${name} requires a value`);
}
index += 1;
return value;
};
if (arg === '--help' || arg === '-h') {
return { ...options, help: true };
}
if (arg === '--from') {
options.from = readValue(arg);
} else if (arg === '--to') {
options.to = readValue(arg);
} else if (arg === '--repo') {
options.repo = readValue(arg);
} else if (arg === '--model') {
options.model = readValue(arg);
} else if (arg === '--output' || arg === '-o') {
options.output = readValue(arg);View on GitHub (pinned to a221052e0d)
Solutions
- Give every value option its argument: `--from latest-release --to latest-tag`
- In CI, guard templated flags: only emit `--from "$FROM"` when $FROM is non-empty (`[ -n "$FROM" ] && set -- --from "$FROM" "$@"` style)
- Note that values beginning with '--' are rejected by design — use a ref/tag name that doesn't
Example fix
# before node scripts/release/generate-release-notes.mjs --from --to latest-tag # → Error: --from requires a value # after node scripts/release/generate-release-notes.mjs --from latest-release --to latest-tag
Defensive patterns
Strategy: validation
Validate before calling
const VALUE_OPTS = new Set(['--from', '--to', '--repo', '--model', '--output', '-o']);
for (let i = 0; i < argv.length; i++) {
const a = argv[i];
if (VALUE_OPTS.has(a)) {
const v = argv[i + 1];
if (!v || v.startsWith('--')) {
console.error(`${a} needs a following value`);
process.exit(2);
}
i++; // skip the value
}
} Prevention
- Quote-and-check templated flags in CI: only append `--from "$FROM"` when $FROM is non-empty
- Keep option values free of a leading '--'; use tag/sha names that start alphanumerically
When it happens
Trigger: `--from` as the last token (`node scripts/release/generate-release-notes.mjs --from`); `--from --to v1.2.3` where the parser sees the next token starting with '--' and refuses rather than consuming it as the value; a CI template variable expanding to empty leaving a dangling flag.
Common situations: Half-edited command lines; templated CI commands with unset variables; intentionally starting a value with '--' (unsupported — reorder or rename).
Related errors
- Unknown option: ${arg}
- Failed to parse service CLI output as JSON: parsed value doe
- paths must be repo-relative, not absolute (got "${p}")
- must be an array
- ${label} must be a positive integer
AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16).
Data as JSON: /api/errors/4cde595a6cec787a.
Report an issue: GitHub.