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
[Bug] Windows binary selection picks AVX version on non-AVX CPUs #8744
The Windows launcher script (bin/opencode) picks opencode-windows-x64 instead of opencode-windows-x64-baseline on CPUs without AVX support, causing immediate crash on startup.
Environment
OS: Windows 11
CPU: Intel/AMD without AVX (only SSE4.2)
opencode-ai version: 1.1.19-1.1.22 (all affected)
Node.js: v22.x
Error
Bun v1.3.6 (d530ed99) Windows x64 (baseline)
CPU: sse42
Features: ... no_avx2 no_avx ...
CPU lacks AVX support. Please consider upgrading to a newer CPU.
panic(main thread): Illegal instruction at address 0x7FF7132980FC
oh no: Bun has crashed.
Root Cause
The launcher script in bin/opencode uses:
constbase="opencode-"+platform+"-"+arch// ...for(constentryofentries){if(!entry.startsWith(base))continue// picks first match}
Both opencode-windows-x64 and opencode-windows-x64-baseline match the pattern opencode-windows-x64. The first match wins, which depends on filesystem ordering (directory enumeration order).
Suggested Fix
Option A: Check AVX support before selecting binary (preferred)
// Detect AVX support and prefer baseline when not availableconsthasAvx=checkCpuFeature('avx');constpreferBaseline=!hasAvx;
Option B: Prefer -baseline suffix when on Windows
// Sort entries to prefer baseline on Windowsentries.sort((a,b)=>{constaBaseline=a.includes('-baseline');constbBaseline=b.includes('-baseline');// Prefer baseline if no AVX detectedreturnpreferBaseline ? (bBaseline-aBaseline) : (aBaseline-bBaseline);});
This affects all Windows users with older CPUs that lack AVX support (pre-2011 Intel, pre-2012 AMD). The crash occurs immediately on startup before any meaningful error message can be displayed, making it difficult to diagnose.
References
Related Bun issue: The crash is in Bun runtime, but the binary selection logic is in OpenCode
Activity
github-actions commentedon Jan 15, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
shaunmorris commentedon Feb 5, 2026
This also affects linux users
github-actions commentedon Apr 7, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.