Android branch in npm shim cannot resolve pruned linux platform packages

Open 💬 0 comments Opened Jun 1, 2026 by bar-d

What happened?

codex-cli/bin/codex.js treats process.platform === "android" the same as Linux and selects the Linux platform packages:

  • @openai/codex-linux-x64
  • @openai/codex-linux-arm64

However, the npm platform packages are emitted with package metadata os: ["linux"], not os: ["android"]. Package managers can therefore prune those optional dependencies on Android, leaving the shim's Android branch unable to resolve the package it selects.

A local install simulation with Android npm platform settings installed only the root package, and importing the shim with process.platform set to android failed with a missing optional dependency for the Linux package.

Expected behavior

Either the shim should not advertise Android support through the Linux package path, or the platform package metadata should allow the Android platform when the Linux binaries are intended to work there.

Additional context

I found broad Android/Termux issues, but I did not find an existing open issue or PR for this specific npm optional-dependency/package-metadata mismatch. I searched for terms including Android, npm shim, optional dependency, linux package, and os=android.

View original on GitHub ↗