Summary
When opencode starts, the auto-upgrade flow can infer installation method from process.execPath (Node/Bun runtime path) instead of the invoked opencode CLI path. In some local setups this can select the wrong installer path and leave the command unavailable after exit.
System information
- OpenCode version: 1.14.41
- Operating system: Linux
Reproduction
- Install and run
opencode in an environment where runtime executable path differs from the installed CLI shim path.
- Start
opencode and allow startup update checks.
- Exit the command.
- Observe that
opencode may no longer resolve in shell.
Expected
opencode remains installed and available after running/exiting.
Proposed fix
Use invoked command path (process.argv[1] fallback chain) in installation method detection heuristics, instead of relying on process.execPath.
Related
Summary
When
opencodestarts, the auto-upgrade flow can infer installation method fromprocess.execPath(Node/Bun runtime path) instead of the invokedopencodeCLI path. In some local setups this can select the wrong installer path and leave the command unavailable after exit.System information
Reproduction
opencodein an environment where runtime executable path differs from the installed CLI shim path.opencodeand allow startup update checks.opencodemay no longer resolve in shell.Expected
opencoderemains installed and available after running/exiting.Proposed fix
Use invoked command path (
process.argv[1]fallback chain) in installation method detection heuristics, instead of relying onprocess.execPath.Related