shekohex / shekohex/opencode-pty
[Windows] Startup crash when opening multiple instances: EBUSY: failed copying files... package bun-pty
Nobody has claimed this yet.
- 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
- Enable
opencode-ptyinopencode.json. - Open a project in OpenCode (Instance A) - Success.
- Attempt to open a second project in a new window (Instance B) - Failure.
- 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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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