shekohex / shekohex/opencode-pty

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

Open
#7 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
582
Forks
59
Avg merge
13h 20m
Merged PRs (30d)
2

Description

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.


Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Reproduce the failure on Windows with opencode-pty enabled using the steps and opencode.jsonc configuration, first with one instance and then with two. Start from the startup installation logs for opencode-pty and bun-pty, and verify completion when multiple OpenCode instances bootstrap without BunInstallFailedError or EBUSY.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, typescript
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.