{"record":{"id":"ebd166ea42f49ef1","repo":"can1357/oh-my-pi","slug":"unsupported-platform-platform","errorCode":null,"errorMessage":"Unsupported platform: ${platform}","messagePattern":"Unsupported platform: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/cli/update-cli.ts","lineNumber":1103,"sourceCode":" * Get the appropriate binary name for this platform.\n */\nfunction getBinaryName(): string {\n\tconst platform = process.platform;\n\tconst arch = process.arch;\n\n\tlet os: string;\n\tswitch (platform) {\n\t\tcase \"linux\":\n\t\t\tos = isMuslLinux() ? \"linux-musl\" : \"linux\";\n\t\t\tbreak;\n\t\tcase \"darwin\":\n\t\t\tos = \"darwin\";\n\t\t\tbreak;\n\t\tcase \"win32\":\n\t\t\tos = \"windows\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Error(`Unsupported platform: ${platform}`);\n\t}\n\n\tlet archName: string;\n\tswitch (arch) {\n\t\tcase \"x64\":\n\t\t\tarchName = \"x64\";\n\t\t\tbreak;\n\t\tcase \"arm64\":\n\t\t\tarchName = \"arm64\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new Error(`Unsupported architecture: ${arch}`);\n\t}\n\n\tif (os === \"windows\") {\n\t\treturn `${APP_NAME}-${os}-${archName}.exe`;\n\t}\n\treturn `${APP_NAME}-${os}-${archName}`;","sourceCodeStart":1085,"sourceCodeEnd":1121,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/cli/update-cli.ts#L1085-L1121","documentation":"Thrown when mapping the running OS (process.platform) to the binary-release OS name (linux/darwin/windows) and the platform is not one of the three the updater ships binaries for. It prevents attempting to download an asset that does not exist.","triggerScenarios":"Running `omp update` on a process.platform value outside \"linux\"|\"darwin\"|\"win32\" — e.g. freebsd, openbsd, aix, sunos, android, or a hypothetical browser/edge runtime.","commonSituations":"Developer running omp on FreeBSD/OpenBSD (Bun runs there without official omp binaries), termux/Android, or invoking the updater from an unusual embedded runtime.","solutions":["Update via the system package manager or build from source instead of the binary updater","Run omp on a supported platform (Linux, macOS, Windows)","Install via npm/bun (npm install -g <pkg>) which uses the JS entry rather than platform binaries","Check `node -p process.platform` to confirm the detected platform and file an issue if it should be supported"],"exampleFix":"// before (FreeBSD)\nomp update  // Unsupported platform: freebsd\n// after\nnpm install -g @oh-my-pi/pi-coding-agent@latest","handlingStrategy":"validation","validationCode":"const supportedPlatforms = new Set([\"linux\", \"darwin\", \"win32\"]);\nif (!supportedPlatforms.has(process.platform)) {\n  console.error(`No binary release for ${process.platform}; use npm/bun install instead.`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runUpdate();\n} catch (err) {\n  if (String(err?.message).startsWith(\"Unsupported platform:\")) {\n    console.error(\"Binary updates unsupported here; install via npm instead.\");\n    return;\n  }\n  throw err;\n}","preventionTips":["Only use the binary updater on Linux, macOS, or Windows","On FreeBSD/OpenBSD/Android use npm or bun installation","Check `process.platform` in CI/scripts before invoking the updater"],"tags":["platform","unsupported-environment","updater","binary-install"],"backgroundTag":"unsupported-platform","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}