{"record":{"id":"ff228732f1d33b2b","repo":"thedotmack/claude-mem","slug":"telemetry-wsl-detection-failed-reporting-is-wsl","errorCode":null,"errorMessage":"Telemetry: WSL detection failed; reporting is_wsl=false","messagePattern":"Telemetry: WSL detection failed; reporting is_wsl=false","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/services/telemetry/common.ts","lineNumber":100,"sourceCode":" * retention, stickiness, lifecycle, and cohort insights.\n */\nexport function buildPersonSet(\n  scrubbed: Record<string, unknown>\n): Record<string, unknown> {\n  const set: Record<string, unknown> = {};\n  for (const key of PERSON_PROPERTY_KEYS) {\n    if (scrubbed[key] !== undefined) set[key] = scrubbed[key];\n  }\n  return set;\n}\n\nfunction detectWsl(): boolean {\n  if (process.platform !== 'linux') return false;\n  try {\n    return Boolean(process.env.WSL_DISTRO_NAME) || os.release().toLowerCase().includes('microsoft');\n  } catch (error) {\n    const err = error instanceof Error ? error : new Error(String(error));\n    logger.warn('SYSTEM', 'Telemetry: WSL detection failed; reporting is_wsl=false', undefined, err);\n    return false;\n  }\n}\n\nexport function buildBaseProperties(): Record<string, unknown> {\n  return {\n    version: packageVersion,\n    os: process.platform,\n    // Kernel release: \"10.0.22631\" distinguishes Win10/Win11 builds, Darwin\n    // major maps to the macOS release, Linux gives the kernel. os.release()\n    // does not throw. System metadata only — never user data.\n    os_version: os.release(),\n    is_wsl: detectWsl(),\n    arch: process.arch,\n    runtime: process.versions.bun ? 'bun' : 'node',\n    runtime_version: process.versions.bun ?? process.versions.node,\n    node_version: process.versions.node,\n    is_ci: Boolean(process.env.CI),","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/thedotmack/claude-mem/blob/e2d1df569a8f04075d40e92461128ece7cf04c82/src/services/telemetry/common.ts#L82-L118","documentation":"Defensive catch inside detectWsl(), which checks WSL_DISTRO_NAME and os.release() for 'microsoft'. Neither call realistically throws on stock runtimes, so this warn signals an exotic runtime failure; the only consequence is is_wsl=false in telemetry person properties.","triggerScenarios":"A runtime or OS shim where process.env access or os.release() throws — effectively unreachable on standard Node/Bun builds.","commonSituations":"Never observed in practice; would appear only in heavily sandboxed or patched runtimes.","solutions":["Ignore it — the impact is a single, slightly wrong telemetry attribute","If it recurs, identify what runtime is executing the process (custom os shim) and report it upstream"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Safe to ignore — at worst one telemetry attribute (is_wsl) is false when it should be true","Only investigate if a custom runtime shim wraps os.release() or process.env"],"tags":["telemetry","wsl","environment-detection"],"backgroundTag":"environment-detection-failed","analyzedSha":"e2d1df569a8f04075d40e92461128ece7cf04c82","analyzedAt":"2026-08-20T23:58:13.836Z","contentChangedAt":"2026-08-20T23:58:13.836Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}