Skip to content

[Bug] Desktop sidecar crashes with Bun panic "integer does not fit in destination type" after ~60s, RSS 22-25GB #23443

Closed as not planned

Description

@evergzzerg-dotcom

Description

OpenCode Desktop (v1.14.18) on Windows 11 crashes the sidecar (opencode-cli.exe / Bun v1.3.11) approximately 60 seconds after launch with:

panic(thread XXXXX): integer does not fit in destination type
oh no: Bun has crashed. This indicates a bug in Bun, not your code.
RSS: 21.99GB | Peak: 21.99GB | Commit: 22.85GB | Machine: 68.64GB

The sidecar memory usage grows from ~0 to 22-25 GB RSS in ~60 seconds before the crash. The crash report URL is:
https://bun.report/1.3.11/ea1af24e28moGuhooC6gngQs347Myw16Jg3rgNCYKERNEL32.DLLut0LCSntdll.dll4/hjBA0eNoFwcENACAMAsBVWM1ENHyosXzc3js53LyYxYYrWApkTHbkEZWRd/gBNAAPKQ

This matches the known Bun Windows issue fixed in PR #29327 (merged Apr 15, 2026) where uv_fs_read return values were truncated from ssize_t to int.

Environment

  • OpenCode version: 1.14.18
  • Bun version: v1.3.11 (bundled sidecar)
  • OS: Windows 11
  • RAM: 68.64 GB
  • Sidecar binary: C:\Users\evera\AppData\Local\OpenCode\opencode-cli.exe (154 MB)

Logs

The crash reproduces consistently. Sample from opencode-desktop_2026-04-19_13-40-07.log:

2026-04-19T19:40:09.465853Z  INFO opencode_lib: Loading done, completing initialisation
2026-04-19T19:40:12.022557Z  INFO sidecar: ERROR service=mcp clientName=github error=MCP error -32601: Method not found failed to get prompts
[... skill duplicate warnings ...]
2026-04-19T19:41:11.744061Z  INFO sidecar: Bun v1.3.11 (af24e281) Windows x64 (baseline)
2026-04-19T19:41:11.745046Z  INFO sidecar: Elapsed: 63880ms | User: 15437ms | Sys: 11078ms
2026-04-19T19:41:11.745143Z  INFO sidecar: RSS: 21.99GB | Peak: 21.99GB | Commit: 22.85GB
2026-04-19T19:41:11.745156Z  INFO sidecar: panic(thread 19228): integer does not fit in destination type
2026-04-19T19:41:11.745173Z  INFO sidecar: oh no: Bun has crashed.

The sidecar restarts automatically but crashes again within ~60 seconds, creating 20+ crash logs per day.

Steps to reproduce

  1. Open OpenCode Desktop on Windows 11
  2. Wait ~60 seconds
  3. Sidecar crashes with panic

Additional context

  • I've set OPENCODE_AUTO_HEAP_SNAPSHOT=1 to capture heap snapshots for diagnosis
  • Removed duplicate skill configurations that were generating warnings
  • The MCP server error (Method not found for prompts) is a separate non-fatal issue
  • Related Bun fix: windows: fix readFile panic on files >2GB oven-sh/bun#29327 (merged Apr 15, but unclear if included in v1.3.12)

Suggested fix

Bundle an updated Bun runtime (1.3.12+) that includes the fix from #29327 in the next OpenCode Desktop release.

Activity

  1. added
    perfIndicates a performance issue or need for optimization
    webRelates to opencode on web / desktop
    on Apr 19, 2026
  2. github-actions commented on Apr 19, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

  3. DrDexter6000 commented on Apr 20, 2026

    @DrDexter6000

    Same crash confirmed — additional evidence (Windows 11, v1.14.18, Bun v1.3.11)

    Experiencing the exact same crash with identical symptoms. Adding my evidence to help with diagnosis.

    Environment

    • OpenCode Desktop: v1.14.18
    • Bun: v1.3.11 (bundled sidecar opencode-cli.exe)
    • OS: Windows 11 Home 26200
    • RAM: 32 GB
    • CPU: AMD Ryzen 9

    Observed behavior

    The sidecar crashes with the same panic: integer does not fit in destination type after memory grows to ~15-25 GB RSS. Multiple independent triggers observed:

    Trigger 1: Startup — no user action needed
    Simply launching OpenCode Desktop causes Bun memory to spike from ~600 MB to 15+ GB within 60 seconds, then crash. This reproduces consistently.

    Trigger 2: /compact command
    Running /compact on a session with 264 messages (2.0 MB content) causes memory to grow from 635 MB to 15+ GB in ~86 seconds, then crash with:

    RSS: 11.84GB | Peak: 19.81GB | Commit: 28.04GB | Faults: 16,540,592
    panic(thread 48480): integer does not fit in destination type
    Sidecar terminated code=Some(3) signal=None
    

    Crash report: https://bun.report/1.3.11/ea1af24e28mhGuhooC6gngQs347Myw16Jg3rgNCYKERNEL32.DLLut0LCSntdll.dll4/hjBA0eNoFwcENACAMAsBVWM1ENHyosXzc3js53LyYx

    Trigger 3: Stale git index.lock in snapshot directory
    A zero-byte stale index.lock in ~/.local/share/opencode/snapshot/<hash>/ caused the snapshot service to enter a retry storm, generating 845 index.lock errors and spawning 136 orphaned git child processes. This drove opencode-cli.exe to 11,203 handles / 5.3 GB working set before crash (normal: ~335 handles / 635 MB).

    Additional data

    • OpenCode SQLite DB: 89 sessions, 6,112 messages, 151.2 MB total content
    • Largest session: 79.4 MB (617 messages) — likely contributing to startup memory pressure
    • Desktop log: $LOCALAPPDATA/ai.opencode.desktop/logs/opencode-desktop_2026-04-20_17-39-35.log contains the full crash trace
    • v1.14.19 tested: Still crashes with the same panic — Bun v1.3.11 likely still bundled

    Workaround attempted

    • Deleting stale index.lock files and restarting fixed Trigger 3
    • No workaround found for Triggers 1 and 2 — OpenCode is currently unusable on this machine
    • Rolling back to v1.4.5 to test if an older Bun runtime avoids the crash

    Root cause aligns with Bun PR #29327 — the ssize_t → int truncation in uv_fs_read on Windows.

  4. removed
    perfIndicates a performance issue or need for optimization
    webRelates to opencode on web / desktop
    on May 3, 2026
  5. Brendonovich commented on May 18, 2026

    @Brendonovich
    Member

    Desktop no longer uses opencode-cli

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