Skip to content

[Bug]: OpenCode 1.2.15 crashes on startup with panic: invalid enum value on Windows 11 (Bun 1.3.10) #15283

Closed as not planned

Description

@alexisvedia

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

  1. Install OpenCode on Windows: npm i -g opencode-ai@latest (v1.2.15)
  2. 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
}
  1. Run opencode in any directory
  2. 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 | cat does 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 value panic 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 ThreadLock panic which was fixed in v1.2.15. This is a different crash signature (invalid enum value vs ThreadLock).

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-x64 binary includes Bun 1.3.10 which cannot be updated independently.

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Feb 26, 2026
  2. alexisvedia commented on Feb 26, 2026

    @alexisvedia
    Author

    Clarification: This is on a standard Windows 11 24H2 stable release (build 26200.7922), NOT an Insider Preview build. The Windows Insider Program is not enrolled. This means the crash affects regular Windows 11 stable installations.

  3. assigned and unassigned on Feb 27, 2026
  4. Hona commented on Feb 27, 2026

    @Hona
    Member

    On it thanks

  5. Corosauce commented on Mar 5, 2026

    @Corosauce
  6. removed
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on May 3, 2026
  7. Indy221 commented on Jun 25, 2026

    @Indy221

    Bun has crashed .. all my OpenCode cli constantly crashes, since today only.

    Was using Warp change to VSCode and same problem...

    Image
  8. github-actions commented on Aug 25, 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.

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