You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[linux] opencode silently exits (code 0) on x86_64 CPUs without AVX2 support when installed via npm #20116
Running opencode after npm install -g opencode-ai produces no output and exits silently with code 0 on x86_64 Linux systems that do not support AVX2 instructions.
Environment
OS: Linux (Debian-based, glibc)
Arch: x86_64 (no AVX2)
Node: v24.13.1
Package: opencode-ai (npm global install)
opencode version: latest (0.0.55 at time of writing)
Steps to reproduce
On an x86_64 machine without AVX2: cat /proc/cpuinfo | grep avx2 returns nothing
npm install -g opencode-ai
Run opencode — no output, exits with code 0
Root cause
Two bugs compound to cause this:
Wrong binary selected during postinstall: postinstall.mjs resolves opencode-linux-x64 (no -baseline suffix) even on CPUs without AVX2. The correct package for non-AVX2 CPUs is
opencode-linux-x64-baseline. The AVX2 check logic exists in the wrapper script bin/opencode but not in postinstall.mjs, so the wrong binary gets hard-linked to bin/.opencode.
Silent failure in wrapper: When the binary is killed by SIGBUS (due to an illegal instruction), spawnSync returns result.status = null. The wrapper then does:
const code = typeof result.status === "number" ? result.status : 0
process.exit(code)
null is not a number, so it exits with code 0 — no error, no output.
Workaround
Install using the official shell installer instead of npm:
In postinstall.mjs: mirror the AVX2 detection logic from bin/opencode to select the correct -baseline package on non-AVX2 x86_64 CPUs.
In bin/opencode: when result.signal is set (e.g. SIGBUS, SIGILL), print a diagnostic error and exit non-zero instead of silently exiting 0:
if (result.signal) {
console.error(opencode binary crashed with signal ${result.signal}. Your CPU may not support the required instructions.)
process.exit(1)
}
Plugins
No response
OpenCode version
No response
Steps to reproduce
On x86_64 machine without AVX2: confirm with grep avx2 /proc/cpuinfo (no output)
Install Node.js (e.g. via nvm): nvm install 24
npm install -g opencode-ai
Run opencode — no output, exits silently with code 0
To confirm the crash: strace -e trace=signal opencode 2>&1 | grep -E "SIGBUS|SIGILL" shows SIGBUS.
If your issue adds new information (particularly the silent exit code 0 via result.signal handling), please link to those issues so maintainers can track the full picture.
Activity
github-actions commentedon Mar 30, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue adds new information (particularly the silent exit code 0 via
result.signalhandling), please link to those issues so maintainers can track the full picture.github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.