Repository navigation
Closed
albertlieyingadrian/opencode
#2Labels
bugSomething isn't workingSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)windows
Description
Description
What happened?
When ".env" exists and has content, opencode with version 1.2.11 will crash when start. It runs fine in version 1.2.10.
The image demonstrates the minimal repeatable sample:

Here is the full error message.
PS C:\Users\chong\Desktop\test> opencode
============================================================
Bun Canary v1.3.10-canary.100 (6b1d6c76) Windows x64 (baseline)
Windows v.win11_dt
CPU: sse42 avx avx2
Args: "C:\Users\chong\AppData\Roaming\npm\node_modules\opencode-ai\node_modules\opencode-windows-x64\bin\opencode.exe" "--user-agent=opencode/1.2.11" "--use-system-ca" "--"
Features: Bun.stderr(2) Bun.stdin(2) Bun.stdout(2) fetch(2) jsc standalone_executable workers_spawned
Builtins: "bun:ffi" "bun:main" "bun:sqlite" "node:assert" "node:async_hooks" "node:buffer" "node:child_process" "node:console" "node:crypto" "node:dns" "node:events" "node:fs" "node:fs/promises" "node:http" "node:https" "node:module" "node:net" "node:os" "node:path" "node:process" "node:querystring" "node:readline" "node:stream" "node:stream/promises" "node:string_decoder" "node:timers" "node:timers/promises" "node:tls" "node:tty" "node:url" "node:util" "undici" "node:v8" "node:http2" "node:diagnostics_channel" "node:dgram"
Elapsed: 535ms | User: 468ms | Sys: 250ms
RSS: 0.59GB | Peak: 0.59GB | Commit: 0.95GB | Faults: 149212 | Machine: 34.06GB
panic(thread 21008): Internal assertion failure: `ThreadLock` is locked by thread 18372, not thread 21008
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
To send a redacted crash report to Bun's team,
please file a GitHub issue using the link below:
https://bun.report/1.3.10/ea26b1d6c7kQugogC+iwgN+xxuK4t2wM8/pM2rmNkxvNm9mQwwn0eCYKERNEL32.DLLut0LCSntdll.dll4gijBA0eNrzzCtJLcpLzFFILC5OLSrJzM9TSEvMzCktSrVSSAjJKEpNTPHJT85OUMgsVsjJT85OTVFIqlQoAUsoGFoYmxvpKOTll8BEjAwNDCwAGpoczw
Plugins
No response
OpenCode version
No response
Steps to reproduce
- Use version 1.2.11 (latest)
- Create a .env file with content
- run
opencode
Screenshot and/or share link
No response
Operating System
Windows 11
Terminal
VScode powershell terminal, and Windows pershell terminal
Reacted by daniel-adb-fa and edision
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcoreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)windows
Activity
github-actions commentedon Feb 25, 2026
This issue might be a duplicate of existing issues. Please check:
ThreadLockassertion failure in Bun Canary v1.3.10-canary.100, same opencode version 1.2.11, same Windows platform — the crash appears to be caused by the same underlying Bun bug rather than specifically the.envfile.HuynhSang2005 commentedon Feb 25, 2026
You can reinstall
opencode-aiat version 1.2.10 using BunFirst, uninstall the current package:
Then, reinstall the package at the specific version you want (in this case, 1.2.10):
This ensures you’re running the stable version
1.2.10instead of upgrading to1.2.11, which may cause errors.DonChong2000 commentedon Feb 25, 2026
Thanks for the prompt response!
I rolled back to 1.2.10 in the image attached, and it's running fine for me.
DonChong2000 commentedon Feb 25, 2026
For others' reference, we need to temporarily stop the auto-update, or the same error will occur again.
To do that, edit opencode.json in
~/.config/opencode/opencode.json, and add"autoupdate": false,like
C:\Users\chong\.config:fix: update Bun to 1.3.10 to resolve .env file crash
Hona commentedon Feb 26, 2026
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 :)
DonChong2000 commentedon Feb 26, 2026
Yes, it works with opencode 1.2.15 with the .env file.
Will try to use it normally and see if there is any other problem.
Really appreciate the fix <3