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
Versions after 1.2.10 use unstable bun canary version which lead to loading project root .env files into bun and crashes opencode on startup #15056
panic(thread 10416): Internal assertion failure: ThreadLock is locked by thread 14580, not thread 10416
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:
These issues describe the same or very similar symptoms: .env file in project root + Bun Canary ThreadLock panic causing opencode to crash on startup in versions 1.2.11+.
Confirmed workaround: move .env to parent directory
Besides downgrading to v1.2.10, I found a cleaner persistent workaround: move the .env file one level up to the parent directory of your project.
Before (crashes):
D:\myproject.env ← Bun auto-loads this → ThreadLock panic
After (works):
D:
└── .env ← Bun doesn't scan parent dirs → no crash
└── myproject\ ← run opencode from here, works fine
This is cleaner than temporarily renaming because the file stays permanently
accessible (source ../.env still works for loading API keys).
Secondary symptom: terminal stuck in mouse-tracking mode after crash
When OpenCode crashes due to this bug, the terminal is left in mouse-tracking
mode. Any subsequent mouse scroll or click prints raw SGR sequences
(screenshot 1 below — this happens continuously until you open a new terminal tab):
The Bun crash itself looks like this (screenshot 2):
Git Bash also works after the fix
After moving .env out of the project root, OpenCode works normally in Git Bash (Windows Terminal) — not just PowerShell. The terminal corruption
from the crash was making Git Bash appear incompatible, but it works fine
once the crash is prevented.
Environment: Windows 11, OpenCode v1.2.12, Windows Terminal (Git Bash + PowerShell)
Reacted by Danil T., Kovalev Anton, Fahri Meral, knight-lightning and Shane Sewell
Activity
github-actions commentedon Feb 25, 2026
This issue might be a duplicate of existing issues. Please check:
These issues describe the same or very similar symptoms: .env file in project root + Bun Canary ThreadLock panic causing opencode to crash on startup in versions 1.2.11+.
FJRG2007 commentedon Feb 25, 2026
I also get this error.
zhenzhuzz commentedon Feb 25, 2026
Confirmed workaround: move
.envto parent directoryBesides downgrading to v1.2.10, I found a cleaner persistent workaround:
move the
.envfile one level up to the parent directory of your project.Before (crashes):
D:\myproject.env ← Bun auto-loads this → ThreadLock panic
After (works):
D:
└── .env ← Bun doesn't scan parent dirs → no crash
└── myproject\ ← run opencode from here, works fine
This is cleaner than temporarily renaming because the file stays permanently
accessible (
source ../.envstill works for loading API keys).Secondary symptom: terminal stuck in mouse-tracking mode after crash
When OpenCode crashes due to this bug, the terminal is left in mouse-tracking
mode. Any subsequent mouse scroll or click prints raw SGR sequences
(screenshot 1 below — this happens continuously until you open a new terminal tab):
The Bun crash itself looks like this (screenshot 2):
Git Bash also works after the fix
After moving
.envout of the project root, OpenCode works normally inGit Bash (Windows Terminal) — not just PowerShell. The terminal corruption
from the crash was making Git Bash appear incompatible, but it works fine
once the crash is prevented.
Environment: Windows 11, OpenCode v1.2.12, Windows Terminal (Git Bash + PowerShell)
DomEscobar commentedon Feb 25, 2026
#15010 (comment)
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 :)