{"record":{"id":"b31010d07b340655","repo":"stablyai/orca","slug":"this-benchmark-requires-a-windows-host-with-wsl","errorCode":null,"errorMessage":"This benchmark requires a Windows host with WSL","messagePattern":"This benchmark requires a Windows host with WSL","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"config/scripts/wsl-hook-relay-reattach-benchmark.mjs","lineNumber":262,"sourceCode":"\nfunction percentile(samples, percentileValue) {\n  const sorted = [...samples].sort((left, right) => left - right)\n  return sorted[Math.ceil((percentileValue / 100) * sorted.length) - 1]\n}\n\nfunction summarize(samples) {\n  return {\n    samples: samples.length,\n    medianMs: Number(percentile(samples, 50).toFixed(1)),\n    p95Ms: Number(percentile(samples, 95).toFixed(1)),\n    minMs: Number(Math.min(...samples).toFixed(1)),\n    maxMs: Number(Math.max(...samples).toFixed(1))\n  }\n}\n\nasync function main() {\n  if (process.platform !== 'win32') {\n    throw new Error('This benchmark requires a Windows host with WSL')\n  }\n  const options = parseArgs(process.argv.slice(2))\n  const distro = await resolveDistro(options.distro)\n  const nodeVersion = await run(\n    'wsl.exe',\n    wslArgs(distro, [\n      '/bin/sh',\n      '-c',\n      'for node_bin in \"$(command -v node 2>/dev/null || true)\" \"$HOME/.local/bin/node\"; do [ -x \"$node_bin\" ] || continue; \"$node_bin\" -p process.versions.node && exit 0; done; exit 1'\n    ]),\n    { allowFailure: true }\n  )\n  if (nodeVersion.status !== 0 || Number(nodeVersion.stdout.trim().split('.')[0]) < 18) {\n    throw new Error(`WSL distro '${distro}' needs Node.js 18 or newer to run Orca's relay`)\n  }\n\n  const bundleDir = join(process.cwd(), 'out', 'relay', 'wsl')\n  const bundlePath = join(bundleDir, 'wsl-agent-hook-relay.js')","sourceCodeStart":244,"sourceCodeEnd":280,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/wsl-hook-relay-reattach-benchmark.mjs#L244-L280","documentation":"Hard platform gate at the top of the WSL benchmark's main(): it refuses to run unless process.platform === 'win32'. The benchmark drives wsl.exe, which only exists on Windows, so on macOS/Linux it aborts immediately rather than producing confusing downstream failures.","triggerScenarios":"Executing `node config/scripts/wsl-hook-relay-reattach-benchmark.mjs` on a non-Windows OS (macOS dev machine, Linux CI runner).","commonSituations":"Running the full benchmark suite on a macOS/Linux developer machine, or a CI matrix that does not skip WSL benchmarks on non-Windows lanes.","solutions":["Run the benchmark on a Windows host (native or Windows CI runner).","If invoking from a script, guard with `process.platform === 'win32'` before calling so non-Windows lanes skip cleanly.","In CI, restrict this benchmark to the windows-latest job and skip it elsewhere."],"exampleFix":"// before\nif (process.platform !== 'win32') {\n  throw new Error('This benchmark requires a Windows host with WSL')\n}\n\n// after — exit zero for CI skips, non-zero only when misinvoked\nif (process.platform !== 'win32') {\n  if (process.env.CI) { console.log('skip: requires Windows'); process.exit(0) }\n  throw new Error('This benchmark requires a Windows host with WSL')\n}","handlingStrategy":"validation","validationCode":"// Skip cleanly on non-Windows in CI before invoking\nif (process.platform !== 'win32' && process.env.CI) {\n  console.log('skip: wsl benchmark requires Windows')\n  process.exit(0)\n}\nif (process.platform !== 'win32') {\n  throw new Error('This benchmark requires a Windows host with WSL')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate CI jobs by OS so the benchmark only runs on windows-latest.","Add a `--help` that prints the Windows-only requirement.","Document the platform requirement at the top of the script."],"tags":["wsl","benchmark","platform-guard","windows"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}