Skip to content

[Windows] Startup crash when opening multiple instances: EBUSY: failed copying files... package bun-pty #7

@mynameistito

Description

@mynameistito

Description

I am experiencing a crash when attempting to open a second instance of OpenCode while the opencode-pty plugin is enabled.

The first instance boots correctly. However, launching a second instance triggers a BunInstallFailedError. The logs indicate an EBUSY error regarding bun-pty, suggesting a file locking issue where the first instance is holding onto the dependency files, preventing the second instance from verifying or copying them from the cache.

Steps to Reproduce

  1. Enable opencode-pty in opencode.json.
  2. Open a project in OpenCode (Instance A) - Success.
  3. Attempt to open a second project in a new window (Instance B) - Failure.
  4. Instance B crashes with a TUI bootstrap failure.

Expected Behavior

Multiple instances of OpenCode should be able to run simultaneously with the opencode-pty plugin enabled, as they do without the plugin.

Actual Behavior

The second instance fails to bootstrap. The process terminates with a BunInstallFailedError.

Logs

INFO  2026-01-18T01:16:55 +5294ms service=bun code=1 stdout=bun add v1.3.5 (1e86cebd)
...
installed opencode-pty@0.1.4

91 packages installed [5.40s]
Failed to install 1 package
 stderr=Resolving dependencies
Resolved, downloaded and extracted [1]
EBUSY: failed copying files from cache to destination for package bun-pty
Saved lockfile
 done
ERROR 2026-01-18T01:16:55 +3ms service=server error=BunInstallFailedError Caused by: Command failed with exit code 1 failed

Console Output:

{
  "name": "BunInstallFailedError",
  "data": {
    "pkg": "opencode-pty",
    "version": "latest"
  }
}

Environment

  • OS: Windows 10 x64
  • OpenCode Version: 1.1.25
  • Bun Version: 1.3.6
  • Plugin Version: opencode-pty@0.1.4 (latest)

Configuration

Here is my current opencode.jsonc:
https://gist.github.com/mynameistito/6198ccbbeee48503f3a6d201f3e4caf4

Additional Context

The error EBUSY: failed copying files from cache to destination for package bun-pty suggests that the native binary for the PTY is currently locked by the OS (used by the first OpenCode instance), preventing Bun from performing its installation/integrity check for the second instance.


Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions