tinyhumansai/openhuman · error · Error
unknown option: ${arg}
Error message
unknown option: ${arg} What it means
Default-case error in harness-subagent-rpc-audit's arg switch. Any token starting with `--` that is not one of the recognized flags reaches `default:` and the parser aborts with the offending token. This is fail-fast CLI surface validation — the script would rather stop than silently ignore a mistyped option.
Source
Thrown at scripts/debug/harness-subagent-rpc-audit.mjs:137
break;
case "--spawn-core":
opts.spawnCore = true;
break;
case "--isolated-workspace":
opts.isolatedWorkspace = true;
break;
case "--keep-workspace":
opts.keepWorkspace = true;
break;
case "--verbose":
opts.verbose = true;
break;
case "-h":
case "--help":
console.log(usage());
process.exit(0);
default:
throw new Error(`unknown option: ${arg}`);
}
}
const scenarios = new Set([
"async-steer",
"parallel-research-code",
"reuse-parent-comm",
"all",
]);
if (!scenarios.has(opts.scenario)) {
throw new Error(
`--scenario must be one of ${Array.from(scenarios).join(", ")}`,
);
}
const providerModes = new Set(["direct-openai", "openhuman-backend"]);
if (!providerModes.has(opts.providerMode)) {
throw new Error(
`--provider-mode must be one of ${Array.from(providerModes).join(", ")}`,
);View on GitHub (pinned to a221052e0d)
Solutions
- Run with `-h` / `--help` and diff the supported flag list against what you passed
- Check for a missed value earlier in the line that shifted everything left
- Remove or correct the unsupported flag
Example fix
# before: --turns belongs to harness-cache-audit, not this runner node scripts/debug/harness-subagent-rpc-audit.mjs --scenario all --turns 3 # after node scripts/debug/harness-subagent-rpc-audit.mjs --scenario all
Defensive patterns
Strategy: validation
Validate before calling
const KNOWN = new Set(["--scenario","--core-url","--token","--workspace","--task-key","--agent-id","--model","--provider-mode","--rpc-timeout-ms","--spawn-wait-ms","--settle-wait-ms","--spawn-core","--isolated-workspace","--keep-workspace","--verbose","-h","--help"]);
const unknown = process.argv.slice(2).filter((a) => a.startsWith("--") && !KNOWN.has(a));
if (unknown.length) { console.error(`unsupported: ${unknown.join(", ")}`); process.exit(2); } Prevention
- Don't copy flag sets between the different scripts/debug/* runners
- Keep a single canonical invocation per runner in a shell script or package.json alias
When it happens
Trigger: Typos (`--spawn-corex`, `--verbse`); flags from a sibling script that this one does not support (e.g. `--turns` or `--min-hit-rate` belong to harness-cache-audit, not this script); a value that starts with `--` because the preceding flag's value was omitted (e.g. `--model --spawn-core` consumes --spawn-core as the model, then the next real flag dangles into an unknown position).
Common situations: Copying a command line between the various scripts/debug/*.mjs runners whose flag sets differ; muscle memory from an older revision of the script.
Related errors
- ${label} must be a positive integer
- missing value for ${arg}
- --scenario must be one of ${Array.from(scenarios).join(", ")
- --provider-mode must be one of ${Array.from(providerModes).j
- ${label} must be a positive integer
AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16).
Data as JSON: /api/errors/21c2d0077b1f3425.
Report an issue: GitHub.