Skip to content

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

Closed as not planned

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

Activity

  1. github-actions commented on Jul 9, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions