-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
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
- Edit
~/.config/opencode/opencode.json - Set plugin to
"[email protected]" - Run opencode, exit
- Reopen opencode
- 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:
- Skip auto-updating prerelease versions entirely
- 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
Labels
No labels