{"record":{"id":"33f6abcaae887753","repo":"stablyai/orca","slug":"unknown-argument-arg-33f6ab","errorCode":null,"errorMessage":"Unknown argument: ${arg}","messagePattern":"Unknown argument: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/repro-windows-apphang-terminal-activation.mjs","lineNumber":85,"sourceCode":"        .filter(Boolean)\n      if (modes.length === 0 || modes.some((mode) => !['on', 'off', 'auto'].includes(mode))) {\n        throw new Error(`Unsupported --gpu=${value}. Use on, off, auto, or a comma-list.`)\n      }\n      args.gpuModes = modes\n      continue\n    }\n    if (name === '--output-lines') {\n      args.outputLines = parsePositiveInt(name, value)\n      continue\n    }\n    if (name === '--report') {\n      args.reportPath = value?.trim() || null\n      if (!args.reportPath) {\n        throw new Error('--report requires a file path.')\n      }\n      continue\n    }\n    throw new Error(`Unknown argument: ${arg}`)\n  }\n\n  return args\n}\n\nfunction printHelp() {\n  console.log(`Usage:\n  node config/scripts/repro-windows-apphang-terminal-activation.mjs [options]\n\nOptions:\n  --expect=none|repro|pass       none prints measurements, repro exits 0 only when hang evidence is observed,\n                                 pass exits 1 if hang evidence is observed. Default: none.\n  --gpu=on|off|auto[,mode...]    Terminal GPU setting(s) to run. Default: on.\n  --cycles=N                     Activation/output cycles per GPU mode. Default: ${defaultCycles}.\n  --output-lines=N               Lines emitted by each terminal stress command. Default: ${defaultOutputLines}.\n  --report=PATH                  Write full JSON evidence to PATH and print a compact summary to stdout.\n  --distro=NAME                  WSL distro to use. Default: first non docker-desktop distro.\n  --no-source-control            Do not open Source Control during the stress loop.","sourceCodeStart":67,"sourceCodeEnd":103,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/repro-windows-apphang-terminal-activation.mjs#L67-L103","documentation":"Thrown by the apphang repro harness CLI parser when an argument does not match any known flag. The parser iterates argv and falls through to this error for unrecognized tokens.","triggerScenarios":"Passing any unrecognized flag like --verbose, --timeout, or a bare positional argument. Known flags are: --expect, --gpu, --cycles, --distro, --output-lines, --report, --no-source-control, --no-dead-pty-reactivate, --keep, --help.","commonSituations":"A developer passes a flag from a different harness, or a typo like --cyles.","solutions":["Run with --help to see the complete list of accepted flags.","Remove the unrecognized argument or correct the typo."],"exampleFix":"// before\nnode config/scripts/repro-windows-apphang-terminal-activation.mjs --verbose\n// after\nnode config/scripts/repro-windows-apphang-terminal-activation.mjs --cycles=20","handlingStrategy":"validation","validationCode":"const KNOWN_FLAGS = new Set(['--expect','--gpu','--cycles','--distro','--output-lines','--report','--no-source-control','--no-dead-pty-reactivate','--keep','--help'])\nconst name = arg.split('=',1)[0]\nif (!KNOWN_FLAGS.has(name)) {\n  throw new Error(`Unknown argument: ${arg}. Run with --help.`)\n}","typeGuard":"function isKnownFlag(arg) {\n  const name = arg.split('=', 1)[0]\n  return new Set(['--expect','--gpu','--cycles','--distro','--output-lines','--report','--no-source-control','--no-dead-pty-reactivate','--keep','--help','-h']).has(name)\n}","tryCatchPattern":null,"preventionTips":["Always provide a --help / -h escape hatch that lists accepted flags.","Suggest the closest match (e.g. did-you-mean) when an unknown flag resembles a known one."],"tags":["cli","validation","argument-parsing","windows"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}