anomalyco / anomalyco/opencode

OpenCode v1.18.4 crashes with Bun libpas heap assertion and illegal instruction error on Windows

Open
#38,721 1 comment 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Jul 24, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description
Summary

When running OpenCode v1.18.4 on Windows 11, Open Code crashes with a Bun panic triggered by libpas heap assertion failure and illegal instruction exceptions. The crash consistently occurs during workflows that generate long AI output JSON strings with multiple workers enabled. Massive memory usage spikes and extreme page faults precede every crash.

This appears to be a runtime-level bug in the embedded Windows standalone Bun build rather than a user configuration or project code issue.

Environment

OS: Windows 11 x64
OpenCode version with crash: 1.18.4
Launch method: Run opencode.exe via VS Code terminal
Global standalone Bun installed separately: No
Embedded Bun version from crash log: Bun v1.3.14 (0d9b296a)
Architecture: windows x64 baseline / windows x86_64_baseline [StandaloneExecutable]
Runtime mode: standalone_executable
CPU Features: sse42, avx, avx2 supported

Crash Output Snippet
Bun v1.3.14 (0d9b296a) Windows x64 (baseline)
CPU:sse42 avx avx2
Args: "C:\Users\DELL\.bun\..\node_modules\opencode-ai\bin\opencode.exe" "--user-agent=opencode/1.18.4" "--use-system-ca" "---"
panic(thread 26236): Illegal instruction at address0x7FF62B5CA852
oh no:Bun has crashed.This indicates a bug inBun, not your code.

Crash stack trace root cause: pas_assertion_failed_inline inside libpas bmalloc heap allocator
Key resource metrics before crash:
RSS: 7.59GB | Peak memory:10.22GB
Virtual memory commit: 27.20GB
Total page faults: over 1.2 billion
Long runtime elapsed before crash: ~5.7 hours
Workers spawned: 2
What I was doing

I launched OpenCode inside a local project through the VS Code terminal.

The crash reproduces reliably under heavy AI workflows with the following characteristics:

  • Multiple parallel sub-agent enabled
  • Large AI model outputs requiring construction of extremely long JSON strings
  • Frequent string buffer resizing and JSON serialization via StringBuilder
  • Long continuous runtime

The crash is an abrupt native process kill, and no regular application-level errors show up in OpenCode logs before the Bun panic. Standard model API errors like timeouts or quota limits appear separately in logs and do not trigger this fatal heap crash on their own.

Plugins

Oh my Openagent v4.19.1

OpenCode version

v1.18.4

Steps to reproduce

No response

Screenshot and/or share link
Image
Operating System

Windows 11 x64

Terminal

VS Code terminal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.