fix: respect user-pinned plugin version, skip auto-update when explicitly pinned

When a user pins oh-my-opencode to a specific version (e.g., oh-my-opencode@3.4.0),
the auto-update checker now respects that choice and only shows a notification toast
instead of overwriting the pinned version with latest.

- Skip updatePinnedVersion() when pluginInfo.isPinned is true
- Show update-available toast only (notification, no modification)
- Added comprehensive tests for pinned/unpinned/autoUpdate scenarios

Fixes #1745
This commit is contained in:
YeonGyu-Kim
2026-02-11 15:39:15 +09:00
parent 308ad1e98e
commit 5d3215167a
2 changed files with 177 additions and 7 deletions
@@ -56,13 +56,9 @@ export async function runBackgroundUpdateCheck(
}
if (pluginInfo.isPinned) {
const updated = updatePinnedVersion(pluginInfo.configPath, pluginInfo.entry, latestVersion)
if (!updated) {
await showUpdateAvailableToast(ctx, latestVersion, getToastMessage)
log("[auto-update-checker] Failed to update pinned version in config")
return
}
log(`[auto-update-checker] Config updated: ${pluginInfo.entry}${PACKAGE_NAME}@${latestVersion}`)
await showUpdateAvailableToast(ctx, latestVersion, getToastMessage)
log(`[auto-update-checker] User-pinned version detected (${pluginInfo.entry}), skipping auto-update. Notification only.`)
return
}
invalidatePackage(PACKAGE_NAME)