{"record":{"id":"21c2d0077b1f3425","repo":"tinyhumansai/openhuman","slug":"unknown-option-arg-21c2d0","errorCode":null,"errorMessage":"unknown option: ${arg}","messagePattern":"unknown option: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/debug/harness-subagent-rpc-audit.mjs","lineNumber":137,"sourceCode":"        break;\n      case \"--spawn-core\":\n        opts.spawnCore = true;\n        break;\n      case \"--isolated-workspace\":\n        opts.isolatedWorkspace = true;\n        break;\n      case \"--keep-workspace\":\n        opts.keepWorkspace = true;\n        break;\n      case \"--verbose\":\n        opts.verbose = true;\n        break;\n      case \"-h\":\n      case \"--help\":\n        console.log(usage());\n        process.exit(0);\n      default:\n        throw new Error(`unknown option: ${arg}`);\n    }\n  }\n  const scenarios = new Set([\n    \"async-steer\",\n    \"parallel-research-code\",\n    \"reuse-parent-comm\",\n    \"all\",\n  ]);\n  if (!scenarios.has(opts.scenario)) {\n    throw new Error(\n      `--scenario must be one of ${Array.from(scenarios).join(\", \")}`,\n    );\n  }\n  const providerModes = new Set([\"direct-openai\", \"openhuman-backend\"]);\n  if (!providerModes.has(opts.providerMode)) {\n    throw new Error(\n      `--provider-mode must be one of ${Array.from(providerModes).join(\", \")}`,\n    );","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/scripts/debug/harness-subagent-rpc-audit.mjs#L119-L155","documentation":"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.","triggerScenarios":"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).","commonSituations":"Copying a command line between the various scripts/debug/*.mjs runners whose flag sets differ; muscle memory from an older revision of the script.","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"],"exampleFix":"# before: --turns belongs to harness-cache-audit, not this runner\nnode scripts/debug/harness-subagent-rpc-audit.mjs --scenario all --turns 3\n\n# after\nnode scripts/debug/harness-subagent-rpc-audit.mjs --scenario all","handlingStrategy":"validation","validationCode":"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\"]);\nconst unknown = process.argv.slice(2).filter((a) => a.startsWith(\"--\") && !KNOWN.has(a));\nif (unknown.length) { console.error(`unsupported: ${unknown.join(\", \")}`); process.exit(2); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["cli","arguments","validation"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}