{"record":{"id":"7c7e496aa80b648a","repo":"stablyai/orca","slug":"the-production-watchdog-is-macos-only-run-this-be","errorCode":null,"errorMessage":"The production watchdog is macOS-only; run this benchmark on macOS","messagePattern":"The production watchdog is macOS-only; run this benchmark on macOS","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"config/scripts/hang-watchdog-memory-benchmark.mjs","lineNumber":256,"sourceCode":"        0,\n        after.physicalFootprintBytes - before.physicalFootprintBytes\n      ),\n      startupMs: worker.startupMs,\n      ...performance\n    }\n  } finally {\n    await worker.shutdown()\n  }\n  rmSync(markerPath, { force: true })\n  return {\n    ...measurements,\n    blockedMainThreadVerified: await verifyBoundary(markerPath, startWorker)\n  }\n}\n\nasync function runInternal() {\n  if (process.platform !== 'darwin') {\n    throw new Error('The production watchdog is macOS-only; run this benchmark on macOS')\n  }\n  const { app } = await import('electron')\n  const boundary = process.env[BOUNDARY_ENV]\n  const profileDir = mkdtempSync(path.join(tmpdir(), 'orca-watchdog-bench-'))\n  app.setPath('userData', profileDir)\n  try {\n    await app.whenReady()\n    const markerPath = path.join(profileDir, 'main-thread-hang.json')\n    const result =\n      boundary === 'child'\n        ? await measureChild(markerPath)\n        : boundary === 'worker'\n          ? await measureWorker(markerPath)\n          : (() => {\n              throw new Error(`Unsupported boundary: ${boundary}`)\n            })()\n    process.stdout.write(`${RESULT_PREFIX}${JSON.stringify(result)}\\n`)\n  } finally {","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/config/scripts/hang-watchdog-memory-benchmark.mjs#L238-L274","documentation":"Thrown by runInternal() (the in-Electron measurement path) when process.platform is not 'darwin'. The production main-thread-hang watchdog relies on macOS-specific tooling — notably `/usr/bin/footprint` for physical memory and macOS process APIs — so results on other platforms would not reflect the shipped watchdog. This is the same guard as error 71, checked here inside the spawned Electron child.","triggerScenarios":"The internal Electron child process starts on Linux or Windows (process.platform !== 'darwin') and reaches runInternal(). Typically happens when the outer runBenchmark platform guard (error 71) was bypassed or the script is invoked directly with the INTERNAL_ENV flag set.","commonSituations":"Forcing the benchmark on a Linux CI runner, invoking the internal entry manually for debugging on a non-Mac dev machine, or containerized macOS-less environments.","solutions":["Run the benchmark on macOS only; on other platforms skip it or gate it in CI with a platform matrix filter.","If debugging the harness logic, run the parts that do not need the watchdog on the target platform instead.","Ensure CI does not schedule this job on ubuntu/windows runners."],"exampleFix":"// before\nnode config/scripts/hang-watchdog-memory-benchmark.mjs --boundary child  # on Linux\n// after: gate by platform\nif [ \"$(uname)\" = \"Darwin\" ]; then node config/scripts/hang-watchdog-memory-benchmark.mjs --boundary child; fi","handlingStrategy":"validation","validationCode":"// Gate the benchmark invocation by platform before launching\nif (process.platform !== 'darwin') {\n  console.warn('hang-watchdog benchmark is macOS-only; skipping')\n  process.exit(0)\n}","typeGuard":"const isMacOS = (): boolean => process.platform === 'darwin'","tryCatchPattern":null,"preventionTips":["Schedule this benchmark only on macOS CI runners.","Wrap CLI invocations in a platform check in shell wrappers."],"tags":["benchmark","platform","macos","watchdog","validation"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}