tinyhumansai/openhuman · error · Error

missing value for ${arg}

Error message

missing value for ${arg}

What it means

Argument-parser error in harness-subagent-rpc-audit's next() helper. When a value-taking flag (--scenario, --core-url, --token, --workspace, --task-key, --agent-id, --model, --provider-mode, --rpc-timeout-ms, --spawn-wait-ms, --settle-wait-ms) is the last token on the command line, argv[++i] is undefined (or an empty string) and the parser throws naming the orphaned flag.

Source

Thrown at scripts/debug/harness-subagent-rpc-audit.mjs:81

    agentId: "researcher",
    model: "",
    providerMode: "openhuman-backend",
    rpcTimeoutMs: 600_000,
    spawnWaitMs: 120_000,
    settleWaitMs: 60_000,
    spawnCore: false,
    isolatedWorkspace: false,
    keepWorkspace: false,
    verbose: false,
    coreUrlExplicit: Boolean(process.env.OPENHUMAN_CORE_RPC_URL),
    agentIdExplicit: false,
  };

  for (let i = 0; i < argv.length; i += 1) {
    const arg = argv[i];
    const next = () => {
      const value = argv[++i];
      if (!value) throw new Error(`missing value for ${arg}`);
      return value;
    };
    switch (arg) {
      case "--scenario":
        opts.scenario = next();
        break;
      case "--core-url":
        opts.coreUrl = next();
        opts.coreUrlExplicit = true;
        break;
      case "--token":
        opts.token = next();
        break;
      case "--workspace":
        opts.workspace = next();
        break;
      case "--task-key":
        opts.taskKey = next();

View on GitHub (pinned to a221052e0d)

Solutions

  1. Re-run with the flag followed by its value: `--scenario async-steer`
  2. Print usage (`-h`) to confirm which flags take values
  3. If the value comes from a variable, verify it is non-empty before invoking (`: "${VAR:?}"`)

Example fix

# before
node scripts/debug/harness-subagent-rpc-audit.mjs --spawn-core --isolated-workspace --scenario

# after
node scripts/debug/harness-subagent-rpc-audit.mjs --spawn-core --isolated-workspace --scenario async-steer
Defensive patterns

Strategy: validation

Validate before calling

const VALUE_FLAGS = new Set(["--scenario","--core-url","--token","--workspace","--task-key","--agent-id","--model","--provider-mode","--rpc-timeout-ms","--spawn-wait-ms","--settle-wait-ms"]);
const argv = process.argv.slice(2);
for (let i = 0; i < argv.length; i++) {
  if (VALUE_FLAGS.has(argv[i]) && (argv[i + 1] === undefined || argv[i + 1] === "")) {
    console.error(`${argv[i]} needs a value`); process.exit(2);
  }
  if (VALUE_FLAGS.has(argv[i])) i++; // skip the value
}

Prevention

When it happens

Trigger: A value flag placed last (`... --scenario` with nothing after), shell line-wrapping that drops the value, or an empty-string value from an unexpanded variable (`--task-key "$TK"` with TK unset under set -u quirks or plain empty). Note a following flag like `--scenario --verbose` does NOT trigger this — it is silently consumed as the value and fails later validation instead.

Common situations: Copy-pasted commands with a truncated tail; CI YAML folding a long command across lines; quoting mistakes that pass "" as the value.

Related errors


AI-assisted analysis of tinyhumansai/openhuman@a221052e0d (2026-08-16). Data as JSON: /api/errors/501ce7d8fb2aca4c. Report an issue: GitHub.