Skip to content

Use managed exact plugin versions for auto updates#4513

Open
biggameking wants to merge 1 commit into
code-yeongyu:devfrom
biggameking:fix/managed-exact-plugin-updates
Open

Use managed exact plugin versions for auto updates#4513
biggameking wants to merge 1 commit into
code-yeongyu:devfrom
biggameking:fix/managed-exact-plugin-updates

Conversation

@biggameking

@biggameking biggameking commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • install the plugin as a managed exact version instead of writing dynamic @latest entries
  • persist channel metadata so auto-update can keep exact-version installs moving forward automatically
  • migrate existing dynamic plugin entries to managed exact versions and roll config back if a background update install fails

Why

oh-my-openagent currently writes dynamic plugin entries such as @latest, which keeps startup coupled to OpenCode's plugin resolution path. When that path is slow or unstable, users can get multi-minute stalls before the plugin even loads. This change does not fix OpenCode core's startup fallback, but it does remove oh-my-openagent from relying on that path after install.

Testing

  • bun test src/cli/config-manager/plugin-name-with-version.test.ts
  • bun test src/cli/config-manager/plugin-detection.test.ts
  • bun test src/hooks/zauc-mocks-bg/background-update-check.test.ts
  • bun test src/hooks/zauc-mocks-ws/workspace-resolution.test.ts
  • bun test src/hooks/auto-update-checker/hook.test.ts
  • bun test src/hooks/zauc-mocks-hook/hook.test.ts
  • bun test src/hooks/auto-update-checker/checker/pinned-version-updater.test.ts

Notes

  • I intentionally left unrelated generated files (bun.lock, assets/oh-my-opencode.schema.json) out of this PR.
  • There is an existing unrelated Windows path assertion issue in plugin-entry.test.ts; it is not introduced by this change.

Summary by cubic

Switch plugin installs to managed exact versions with a persisted release channel. This removes @latest stalls at startup and lets auto‑update advance pinned installs safely.

  • New Features

    • Installs oh-my-openagent@<version> via resolvePluginInstallReference, returning the exact entry and its channel.
    • Persists channel metadata in a config-scoped ...-plugin-state.json so updates track the right channel.
    • Background updater migrates dynamic/unpinned entries to exact versions, writes state, and reverts the config on failure.
    • Version bumps preserve the canonical alias (e.g., keep oh-my-openagent, migrate legacy oh-my-opencode safely).
  • Migration

    • No manual steps. Existing dynamic entries are converted to exact versions during install or the next background check.
    • If an update fails, the config entry is rolled back automatically.

Written for commit a186d12. Summary will update on new commits. Review in cubic

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Before we can merge this PR, we need you to sign our Contributor License Agreement (CLA).

To sign the CLA, please comment on this PR with:

I have read the CLA Document and I hereby sign the CLA

This is a one-time requirement. Once signed, all your future contributions will be automatically accepted.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant