Skip to content

[Windows] Crash on startup: Bun Canary v1.3.10 panic - Internal assertion failure: ThreadLock is locked by wrong thread #15010

Closed

Description

@Acidmoon

Description

Description

When running opencode on Windows 11, the application crashes immediately on startup with a Bun internal panic error related to ThreadLock. The error indicates that a lock is held by one thread but accessed by another, suggesting a race condition or threading bug in the bundled Bun Canary version.

This happens consistently when running the command in any directory on the E: drive (and potentially other non-system drives).

Error Output

============================================================
Bun Canary v1.3.10-canary.100 (6b1d6c76) Windows x64 (baseline)
Windows v.win11_dt
CPU: sse42 avx avx2
Args: "D:\DevTools\npm-global\node_modules\opencode-ai\node_modules\opencode-windows-x64\bin\opencode.exe" "--user-agent=opencode/1.2.11" "--use-system-ca" "--"
...
panic(thread 16724): Internal assertion failure: `ThreadLock` is locked by thread 14356, not thread 16724
oh no: Bun has crashed. This indicates a bug in Bun, not your code.

### Plugins

_No response_

### OpenCode version

1.2.11

### Steps to reproduce


1. Install `opencode-ai` globally via npm: `npm install -g opencode-ai`
2. Navigate to any folder on a non-system drive (e.g., `E:\Fitness-ai-backend`)
3. Run the command: `opencode`
4. Observe immediate crash with the above panic message.


### Screenshot and/or share link

_No response_

### Operating System

Windows 11

### Terminal

Windows Terminal

Activity

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

    @github-actions
    Contributor

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

  3. JingxuanZhang commented on Feb 25, 2026

    @JingxuanZhang

    npm install -g opencode-ai@1.2.10, add env OPENCODE_DISABLE_AUTOUPDATE=1 until offical fix this bug

  4. Acidmoon commented on Feb 25, 2026

    @Acidmoon
    Author

    npm install -g opencode-ai@1.2.10, add env OPENCODE_DISABLE_AUTOUPDATE=1 until offical fix this bugNPM 安装 -g opencode-ai@1.2.10,在官方修复此 bug 之前添加 env OPENCODE_DISABLE_AUTOUPDATE=1

    OK,I will try it,thank u.

  5. BenjaminAaron196 commented on Feb 25, 2026

    @BenjaminAaron196

    A very serious issue, hope the official can fix it as soon as possible, completely unable to start

  6. ciihom commented on Feb 25, 2026

    @ciihom

    使用 npm install -g opencode-ai@1.2.10 安装 opencode-ai,并添加环境变量。 OPENCODE_DISABLE_AUTOUPDATE=1在官方修复此漏洞之前

    Correct

  7. razzh7 commented on Feb 25, 2026

    @razzh7

    same issue in windows11

  8. FJRG2007 commented on Feb 25, 2026

    @FJRG2007

    I have the same problem. Since today, I haven't been able to access OpenCode on Windows 11, even after installing the latest version.

    Is there any news about whether this is being worked on to resolve the issue as soon as possible?

  9. oldiberezkoo commented on Feb 25, 2026

    @oldiberezkoo

    temporary workaround: for powershell

    setx OPENCODE_DISABLE_AUTOUPDATE 1
    npm install -g opencode-ai@1.2.10 # or bun...

    Anyone who applies this workaround should set a reminder to remove this environment variable in three days in order to resume receiving updates.

  10. Hona commented on Feb 25, 2026

    @Hona
    Member

    downgrade as others have mentioned.
    I'm working on a minimal repro for the bun team and ideally I will submit a fix PR.

  11. radoslawg commented on Feb 25, 2026

    @radoslawg

    I was puzzled why this happens for only one of my projects. I wiped my whole configuration to no avail.

    The other workaround that works for me is to move .env file out of directory you starting opencode on.

  12. Hona commented on Feb 25, 2026

    @Hona
    Member

    I've created a minimal repro.
    oven-sh/bun#27431

    In theory if the runtime pwd doesnt contain a .env file we should be fine.
    Seeing about a PR shortly

  13. Hona commented on Feb 26, 2026

    @Hona
    Member

    please upgrade to latest OpenCode v1.2.15 - and try again.

    There should be no more segfaults/crashes.

    Can you confirm it works fine after the version is >v1.2.15 :)

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)windows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions