{"record":{"id":"bb5ba73eee72ad66","repo":"headroomlabs-ai/headroom","slug":"unsupported-platform-system-machine","errorCode":null,"errorMessage":"Unsupported platform: {system} {machine}","messagePattern":"Unsupported platform: (.+?) (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"headroom/graph/installer.py","lineNumber":38,"sourceCode":"\nGITHUB_RELEASE_URL = f\"https://github.com/{CBM_REPO}/releases/download\"\n\n\ndef _detect_platform() -> str:\n    \"\"\"Detect platform and return the release asset suffix.\"\"\"\n    system = platform.system().lower()\n    machine = platform.machine().lower()\n\n    if system == \"darwin\":\n        arch = \"arm64\" if machine == \"arm64\" else \"amd64\"\n        return f\"darwin-{arch}\"\n    elif system == \"linux\":\n        arch = \"arm64\" if machine in (\"aarch64\", \"arm64\") else \"amd64\"\n        return f\"linux-{arch}\"\n    elif system == \"windows\":\n        return \"windows-amd64\"\n\n    raise RuntimeError(f\"Unsupported platform: {system} {machine}\")\n\n\ndef get_cbm_path() -> Path | None:\n    \"\"\"Find codebase-memory-mcp binary, return path or None.\"\"\"\n    # Check PATH first\n    found = shutil.which(CBM_BIN_NAME)\n    if found:\n        return Path(found)\n\n    # Check our install location\n    installed = CBM_BIN_DIR / CBM_BIN_NAME\n    if installed.exists() and installed.is_file():\n        return installed\n\n    return None\n\n\ndef download_cbm(version: str | None = None) -> Path:","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/headroomlabs-ai/headroom/blob/322425c43bffde1ed0b64fecf3cf5951565dd82b/headroom/graph/installer.py#L20-L56","documentation":"Raised by _detect_platform in headroom.graph.installer when platform.system()/platform.machine() return a combination outside darwin/linux/windows. The installer maps the host OS+arch to a release asset suffix (darwin-arm64, linux-amd64, ...) for the codebase-memory-mcp binary; anything unmappable (e.g. FreeBSD, a exotic musl container reporting oddly, or mocked platform values in tests) aborts before any download.","triggerScenarios":"Running the CBM installer flow (install/ensure of codebase-memory-mcp) on an OS whose platform.system() is 'freebsd', 'sunos', 'java' (Jython), or empty; occasionally on heavily stripped containers where platform detection misbehaves. Linux aarch64/arm64, x86_64, darwin arm64/other, and windows are all handled.","commonSituations":"Trying headroom's graph/CBM features on BSD or a niche VM; cross-compiling environments; test harnesses that monkeypatch platform; ARM Linux variants reporting machine names other than aarch64/arm64 (they fall back to amd64, which then mismatches the real arch at runtime).","solutions":["Run on a supported platform (macOS, Linux, Windows) — check platform.system() first to see what your host reports.","If the binary exists for your arch under a different name, pre-install codebase-memory-mcp on PATH (get_cbm_path checks PATH first) so the downloader never runs.","On unusual Linux arch names, verify with uname -m; if it is not aarch64/arm64 the code assumes amd64, so ensure an amd64 binary is actually correct.","For truly unsupported systems, disable/skip the graph feature rather than calling the installer."],"exampleFix":"# before\n# on FreeBSD: installer fails 'Unsupported platform: freebsd amd64'\n\n# after: pre-install the binary so detection is bypassed\n$ cp codebase-memory-mcp ~/.local/bin/ && export PATH=\"$HOME/.local/bin:$PATH\"","handlingStrategy":"validation","validationCode":"import platform\n\nsystem, machine = platform.system().lower(), platform.machine().lower()\nif system not in (\"darwin\", \"linux\", \"windows\"):\n    raise SystemExit(f\"CBM installer unsupported on {system} {machine}; \"\n                     \"pre-install the binary on PATH instead\")","typeGuard":"def platform_supported_for_cbm() -> bool:\n    return platform.system().lower() in {\"darwin\", \"linux\", \"windows\"}","tryCatchPattern":"try:\n    install_cbm()\nexcept RuntimeError as e:\n    if str(e).startswith(\"Unsupported platform\"):\n        logger.warning(\"skipping CBM install: %s\", e)\n    else:\n        raise","preventionTips":["Gate installer calls on a platform allow-list before invoking them.","Pre-install the codebase-memory-mcp binary on PATH so the downloader is never reached.","In tests, monkeypatch platform consistently rather than relying on runner OS."],"tags":["platform","installer","binary","unsupported-os","environment"],"backgroundTag":null,"analyzedSha":"322425c43bffde1ed0b64fecf3cf5951565dd82b","analyzedAt":"2026-08-15T01:03:05.481Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}