Skip to content

[Bug]: Installer-pinned versions are treated as user-pinned, preventing auto-update for all installer users #1920

@smilebank7

Description

@smilebank7

Prerequisites

  • I will write this issue in English (see our Language Policy)
  • I have searched existing issues to avoid duplicates
  • I am using the latest version of oh-my-opencode
  • I have read the documentation or asked an AI coding agent with this project's GitHub URL loaded and couldn't find the answer

Bug Description

After the #1745 fix (shipped in v3.5.2), the auto-updater treats all exact-versioned plugin entries as "user-pinned" and skips auto-update. Since the installer (bunx oh-my-opencode install) always writes an exact version (e.g., oh-my-opencode@3.5.2), every user who installed via the official installer is stuck on their install-time version with no auto-update.

The core issue is that isPinned in plugin-entry.ts cannot distinguish between:

  • Installer-pinned: addPluginToOpenCodeConfig(version) writes oh-my-opencode@3.5.2 automatically
  • User-pinned: user manually edits opencode.json to lock a specific version

Both produce the same format (oh-my-opencode@X.Y.Z), so the auto-updater skips both.

Steps to Reproduce

  1. Install oh-my-opencode via bunx oh-my-opencode install (writes oh-my-opencode@3.5.2 to opencode.json)
  2. New version is released (e.g., 3.7.1)
  3. Restart opencode — toast shows "v3.7.1 available. Restart to apply."
  4. Restart opencode again — same toast, version still 3.5.2
  5. Check ~/.cache/opencode/package.json — still "oh-my-opencode": "3.5.2", confirming bun install was never triggered

Expected Behavior

Users who installed via the official installer should receive auto-updates. Only users who manually edit opencode.json to pin a specific version should be excluded from auto-update.

Actual Behavior

The auto-updater detects the update, shows a toast notification ("Restart to apply"), but never actually updates the config or runs bun install. Restarting has no effect. The relevant code path:

// background-update-check.ts
if (pluginInfo.isPinned) {
  await showUpdateAvailableToast(ctx, latestVersion, getToastMessage)
  log(`User-pinned version detected (${pluginInfo.entry}), skipping auto-update.`)
  return  // exits without calling updatePinnedVersion() or bun install
}
// plugin-entry.ts
const isPinned = pinnedVersion !== "latest"
// "oh-my-opencode@3.5.2" → isPinned = true (same result for installer and user)

Additionally, the toast message "Restart to apply" is misleading — restarting does nothing because the config file was never modified.

Doctor Output

 oMoMoMoMo Doctor 

System Information
────────────────────────────────────────
  ✓ opencode    1.2.6
  ✓ oh-my-opencode 3.5.2
  ✓ loaded      3.5.2
  ✓ bun         1.3.9
  ✓ path        /Users/jhin/.opencode/bin/opencode

Configuration
────────────────────────────────────────
  ✓ /Users/jhin/.config/opencode/opencode.json (valid)

Tools
────────────────────────────────────────
  ✓ LSP         2/4 installed
  ✓ ast-grep CLI installed
  ✓ ast-grep napi installed
  ✗ comment-checker not found
  ✓ gh CLI installed

MCPs
────────────────────────────────────────
  ✓ context7
  ✓ grep_app

Issues
────────────────────────────────────────
1. Loaded plugin is outdated
   Loaded 3.5.2, latest 3.7.1.
   Fix: Update: cd ~/.config/opencode && bun update oh-my-opencode
   Affects: plugin features

2. Comment checker unavailable
   Comment checker binary is not installed.
   Fix: Install @code-yeongyu/comment-checker
   Affects: comment-checker hook

Summary
────────────────────────────────────────
  2 passed, 0 failed, 2 warnings
  Total: 4 checks in 894ms

Error Logs

No errors in logs — the auto-updater silently skips the update and only shows a toast.

Configuration

{
  "plugin": [
    "oh-my-opencode@3.5.2",
    "opencode-antigravity-auth@1.5.1"
  ]
}

Additional Context

Timeline of related issues:

Issue Date Effect
#402 Jan 2 Requested auto-update → implemented (overwrites all versions)
#1745 Feb 11 Reported overwrite bug → fixed by skipping isPinned=true
This issue Feb 17 Side effect: installer-pinned users also skipped → no auto-update for anyone

Evidence from source code:

  • tui-installer.ts / cli-installer.ts: addPluginToOpenCodeConfig(version) always writes exact version
  • plugin-entry.ts: isPinned = pinnedVersion !== "latest" — no way to distinguish installer vs user
  • background-update-check.ts: if (pluginInfo.isPinned) { return } — skips update entirely

Possible solutions:

  1. Installer writes "oh-my-opencode" (unpinned) instead of "oh-my-opencode@X.Y.Z"
  2. Installer writes "oh-my-opencode@latest" — already treated as unpinned by isPinned logic
  3. Add metadata (e.g., "installer_managed": true in oh-my-opencode.json) to distinguish intent

Operating System

macOS

OpenCode Version

1.2.6

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