Skip to content

opencode command disappears after first run due to install-method misdetection during upgrade #26473

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 appears to select the wrong installer and can 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.

Activity

  1. github-actions commented on May 9, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Missing system information: please include your OpenCode version and operating system. This context is important for diagnosing and reproducing the issue.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    • [FEATURE]: Smart auto-upgrade based on installation method #23435: [FEATURE]: Smart auto-upgrade based on installation method — describes the same root problem (install method misdetection via process.execPath) and proposes the same fix direction (process.argv[1] / invoked path). Consider adding your bug report details there, or linking the two.
    • opencode upgrade issue #358: opencode upgrade issue — upgrade completes but the new version doesn't take effect (related symptom)

    If you believe this was flagged incorrectly, please let a maintainer know.

  2. github-actions commented on May 9, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

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