Skip to content

opencode exits immediately with Illegal instruction on WSL2/Linux (ACP unusable) #18411

Closed as not planned

Description

@superxcreator

Describe the bug

opencode cannot start in my environment. It exits immediately, and ACP integration fails because no session ID is returned.

Environment

  • OS: WSL2 (Linux kernel 6.6.87.2-microsoft-standard-WSL2)
  • OpenCode package: opencode-ai@1.2.27
  • Node: v22.22.0

Reproduction

  1. Install:

    npm i -g opencode-ai@latest
  2. Run:

    opencode

    It exits immediately (no TUI/session).

  3. Run packaged binary directly:

    ~/.npm-global/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64/bin/opencode --version

    Result:
    Illegal instruction (core dumped)

  4. Baseline binary also fails:

    ~/.npm-global/lib/node_modules/opencode-ai/node_modules/opencode-linux-x64-baseline/bin/opencode --version

    Result:
    Illegal instruction (core dumped)

  5. ACP side effect (acpx):

    • acpx opencode sessions new only prints:
      spawning agent: npx -y opencode-ai acp
    • then exits without returning a valid session ID.

Expected behavior

opencode should start normally on supported WSL2/Linux environments and ACP should return a valid session ID.

Actual behavior

Binary crashes with Illegal instruction, making both CLI and ACP unusable.

Additional context

Other ACP agents (e.g., Codex) work in the same host, so this appears specific to OpenCode binary/runtime compatibility in this environment.

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Mar 20, 2026
  2. github-actions commented on Mar 20, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The common thread across these issues is that opencode's bundled Bun binary requires AVX/AVX2 CPU instructions, and environments lacking those (including some WSL2 setups or older CPUs) crash with Illegal instruction. Please check if any of these match your situation before this issue proceeds.

  3. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  4. github-actions commented on Jul 4, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  5. glepretre commented on Jul 6, 2026

    @glepretre

    Another unresolved legitimate issue closed by a bot

  6. Knetic commented on Sep 15, 2026

    @Knetic

    The common thread across these issues is that opencode's bundled Bun binary requires AVX/AVX2 CPU instructions

    The bot at least did find the issue in my case , and this is a dupe of other issues - I'm using a very old core2 duo proc, and bun's decision to require amd64v3+ means that my cpu platform can't use it.
    This is odd, since afaik every native language (go/gcc/clang/nim/d/rust/etc) default to emitting amd64v1 binaries, unless a distro or user explicitly says to use a different variant (which is uncommon). Not something opencode can change, it's another flaw with Bun.

    Since this is the top search result, i'll mention i tried what was suggested in this previous thread (use mainline from releases page) which didn't work - same error.
    There is a fork of bun+opencode that addresses this issue.

    What i did was follow this guy's path, which was to use a different harness entirely that doesn't have this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions