-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[Bug]: OpenCode 1.2.15 crashes on startup with panic: invalid enum value on Windows 11 (Bun 1.3.10) #15283
Copy link
Copy link
Open
Labels
opentuiThis relates to changes in v1.0, now that opencode uses opentuiThis relates to changes in v1.0, now that opencode uses opentuiwindows
Description
Description
OpenCode 1.2.15 crashes immediately on startup with a Bun panic invalid enum value. The TUI never renders — it exits with code 3 right after launch.
This is NOT the ThreadLock panic fixed in v1.2.15 (#15127). It's a different Bun crash (invalid enum value) that persists even after the ThreadLock fix.
Environment
- OpenCode version: 1.2.15 (latest via
npm i -g opencode-ai@latest) - Bun version: 1.3.10 (bundled with opencode-windows-x64)
- OS: Windows 11 Home (10.0.26200.7922)
- Architecture: x86_64
- Terminal: Windows Terminal / Git Bash (MSYS2)
Steps to Reproduce
- Install OpenCode on Windows:
npm i -g opencode-ai@latest(v1.2.15) - Create a minimal config at
~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"model": "google/antigravity-gemini-3-flash",
"provider": {
"google": {
"name": "Google",
"models": {
"antigravity-gemini-3-flash": {
"name": "Gemini 3 Flash",
"limit": { "context": 1048576, "output": 65536 }
}
}
}
},
"plugin": ["opencode-antigravity-auth@latest"],
"autoupdate": false
}- Run
opencodein any directory - TUI crashes immediately — exits with code 3
Crash Output
The Bun panic output shows:
panic(thread): invalid enum value
Build ID: ea130e609e
OS: x86_64 windows msys
Full Bun crash report URL:
https://bun.report/1.3.10/ea130e609emxGz/3/9/Dkj2hKyn0sGgxiL0k54Jgi++MCY
Investigation
- Empty config also crashes: Tested with
{}config — same crash. - Piped output does NOT crash:
opencode 2>&1 | catdoes NOT crash because the TUI is disabled when stdout is not a terminal. This makes debugging misleading. - Server mode works: The crash is specifically in the TUI rendering path, not in the server/core logic.
- This is a Bun bug: Related to oven-sh/bun#14844 — same
invalid enum valuepanic on Windows. The underlying cause appears to be in Bun's terminal/TUI handling on Windows. - Not the ThreadLock bug: Issue Bun crash when .env file contains any content (ThreadLock panic) #15127 reports a
ThreadLockpanic which was fixed in v1.2.15. This is a different crash signature (invalid enum valuevsThreadLock).
Expected Behavior
OpenCode TUI should start and render normally.
Actual Behavior
OpenCode exits immediately with code 3 and a Bun panic. No TUI is ever displayed.
Workaround
None currently. OpenCode is completely unusable on this Windows machine.
Additional Context
- Previous OpenCode versions (0.15.x) worked on this same machine with the same Bun setup.
- The crash happens with any model/provider configuration, even an empty config.
- The bundled
opencode-windows-x64binary includes Bun 1.3.10 which cannot be updated independently.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
opentuiThis relates to changes in v1.0, now that opencode uses opentuiThis relates to changes in v1.0, now that opencode uses opentuiwindows