Skip to content

opencode command disappears after exit because auto-upgrade misdetects install method #26479

@vsiegel

Description

@vsiegel

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

  1. Install and run opencode in an environment where runtime executable path differs from the installed CLI shim path.
  2. Start opencode and allow startup update checks.
  3. Exit the command.
  4. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions