Environment
- OS: Windows 10
- Installation method:
npm install -g opencode-ai
- Shell: WezTerm
- Package manager: npm
Description
I've been using OpenCode daily for approximately two months without issues.
Recently, I discovered what appears to be a reproducible bug. After launching multiple OpenCode instances, the global opencode command disappears from the system.
This is not just the running process crashing, the executable is no longer available in any terminal until I reinstall the package.
Steps to Reproduce
- Install OpenCode:
npm install -g opencode-ai
- Verify it works:
-
Open a second terminal and start another opencode instance.
-
Open a third terminal and start a third opencode instance.
-
The third launch fails, and afterwards the opencode command is no longer recognized anywhere.
Expected Behavior
Launching multiple OpenCode instances should work independently, or fail gracefully if there is a limitation.
The global CLI installation should never be modified or removed.
Actual Behavior
After attempting to launch the third instance:
'opencode' is not recognized as an internal or external command,
operable program or batch file.
Running:
returns:
INFO: Could not find files for the given pattern(s).
Additionally:
shows:
Motice that the version is missing, suggesting the global installation has become corrupted.
The only way to recover is to reinstall:
npm uninstall -g opencode-ai
npm install -g opencode-ai
However, reproducing the same sequence causes the issue again.
Additional Notes
-
This is reproducible on my machine.
-
It only occurs when launching multiple OpenCode processes.
-
The issue appeared after using OpenCode successfully for about two months.
-
I did not update Node.js, npm, or OpenCode immediately before the issue started.
-
My suspicion is that multiple instances may be racing on a self-update, installation, or lockfile operation that affects the global npm installation.
I'd be happy to test a debug build or provide additional logs if needed.
Plugins
None
OpenCode version
1.17.14
Environment
npm install -g opencode-aiDescription
I've been using OpenCode daily for approximately two months without issues.
Recently, I discovered what appears to be a reproducible bug. After launching multiple OpenCode instances, the global
opencodecommand disappears from the system.This is not just the running process crashing, the executable is no longer available in any terminal until I reinstall the package.
Steps to Reproduce
Open a second terminal and start another
opencodeinstance.Open a third terminal and start a third
opencodeinstance.The third launch fails, and afterwards the
opencodecommand is no longer recognized anywhere.Expected Behavior
Launching multiple OpenCode instances should work independently, or fail gracefully if there is a limitation.
The global CLI installation should never be modified or removed.
Actual Behavior
After attempting to launch the third instance:
Running:
returns:
Additionally:
shows:
Motice that the version is missing, suggesting the global installation has become corrupted.
The only way to recover is to reinstall:
However, reproducing the same sequence causes the issue again.
Additional Notes
This is reproducible on my machine.
It only occurs when launching multiple OpenCode processes.
The issue appeared after using OpenCode successfully for about two months.
I did not update Node.js, npm, or OpenCode immediately before the issue started.
My suspicion is that multiple instances may be racing on a self-update, installation, or lockfile operation that affects the global npm installation.
I'd be happy to test a debug build or provide additional logs if needed.
Plugins
None
OpenCode version
1.17.14