Skip to content

Auto-update checker downgrades beta versions to stable latest #613

@jkoelker

Description

@jkoelker

Bug Description

When a user pins oh-my-opencode to a beta version (e.g., [email protected]), the auto-update checker incorrectly "updates" it to the stable latest version from npm (currently 2.14.0).

Steps to Reproduce

  1. Edit ~/.config/opencode/opencode.json
  2. Set plugin to "[email protected]"
  3. Run opencode, exit
  4. Reopen opencode
  5. Check config - version has been changed to 2.14.0

Expected Behavior

Beta/prerelease pinned versions should NOT be auto-updated to stable versions. The auto-updater should either:

  1. Skip auto-updating prerelease versions entirely
  2. Only update to newer versions within the same prerelease track

Root Cause

In src/hooks/auto-update-checker/index.ts lines 102-109:

if (pluginInfo.isPinned) {
  const updated = updatePinnedVersion(pluginInfo.configPath, pluginInfo.entry, latestVersion)
  // ...
}

The logic fetches npm's latest tag (stable) and updates ANY pinned version to it, including prerelease versions.

Suggested Fix

Add a check to skip auto-updating when the pinned version contains - (prerelease indicator):

if (pluginInfo.isPinned) {
  // Don't auto-update prerelease versions to stable
  if (pluginInfo.pinnedVersion?.includes('-')) {
    log(`[auto-update-checker] Skipping auto-update for prerelease version: ${pluginInfo.pinnedVersion}`)
    return
  }
  // ... existing update logic
}

Workaround

Disable auto-update checker in oh-my-opencode.json:

{
  "disabled_hooks": ["auto-update-checker"]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions