tinyhumansai/openhuman · error · Error

--scenario must be one of ${Array.from(scenarios).join(", ")

Error message

--scenario must be one of ${Array.from(scenarios).join(", ")}

What it means

Post-parse validation in harness-subagent-rpc-audit. opts.scenario must be one of the four audit scenarios the script knows how to drive — async-steer, parallel-research-code, reuse-parent-comm, or all — and anything else is rejected before any RPC or workspace work happens.

Source

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

      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(", ")}`,
    );
  }
  return opts;
}

function parsePositiveInt(raw, label) {
  const value = Number(raw);
  if (!Number.isInteger(value) || value < 1) {
    throw new Error(`${label} must be a positive integer`);
  }
  return value;

View on GitHub (pinned to a221052e0d)

Solutions

  1. Use exactly one of: async-steer, parallel-research-code, reuse-parent-comm, all
  2. Check `-h` output for the current scenario list if the script was recently updated

Example fix

# before
node scripts/debug/harness-subagent-rpc-audit.mjs --scenario parallel-research

# after
node scripts/debug/harness-subagent-rpc-audit.mjs --scenario parallel-research-code
Defensive patterns

Strategy: validation

Validate before calling

const SCENARIOS = new Set(["async-steer","parallel-research-code","reuse-parent-comm","all"]);
const s = process.env.AUDIT_SCENARIO ?? "all";
if (!SCENARIOS.has(s)) { console.error(`scenario must be one of ${[...SCENARIOS].join(", ")}`); process.exit(2); }

Type guard

const SCENARIOS = new Set(["async-steer","parallel-research-code","reuse-parent-comm","all"]);
function isScenario(v) { return typeof v === "string" && SCENARIOS.has(v); }

Prevention

When it happens

Trigger: Passing a scenario name that does not exist (`--scenario parallel-research`), a renamed scenario after a script update, or leaving a placeholder value in a templated command.

Common situations: Script revised and a scenario renamed; the value silently swallowed from a different flag; tab-completion guessing.

Related errors


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