Skip to content

Conversation

@aw338WoWmUI
Copy link
Contributor

@aw338WoWmUI aw338WoWmUI commented Jan 11, 2026

Summary

  • Installer now writes version-aware plugin entries based on npm dist-tags
  • Fixes beta users unexpectedly loading stable version after installation

Problem

When users installed with bunx oh-my-opencode@3.0.0-beta.3 install, the installer wrote "oh-my-opencode" without version. On next OpenCode startup, npm resolved this to latest tag (2.14.0), not the beta version the user intended.

Solution

Query npm dist-tags and write appropriate version suffix:

Installation Command Writes Behavior
bunx oh-my-opencode install @latest Tracks stable releases
bunx oh-my-opencode@beta install @beta Tracks beta tag
bunx oh-my-opencode@3.0.0-beta.2 install @3.0.0-beta.2 Pins to specific version

Changes

  • Added fetchNpmDistTags() to query npm registry for all dist-tags
  • Added getPluginNameWithVersion() to determine correct plugin entry format
  • Updated addPluginToOpenCodeConfig() to use version-aware entries
  • Added comprehensive tests for all scenarios (tag matching, network failure, etc.)

Testing

bun test src/cli/config-manager.test.ts  # 10 tests pass
bun run typecheck                         # No errors

Summary by cubic

Fixes the CLI installer to write a version-aware oh-my-opencode plugin entry based on npm dist-tags. This keeps beta/next installs on their intended channel instead of falling back to stable.

  • Bug Fixes
    • Query npm dist-tags and write the correct entry:
      • bunx oh-my-opencode install → oh-my-opencode@latest
      • bunx oh-my-opencode@beta install → oh-my-opencode@beta
      • bunx oh-my-opencode@next install → oh-my-opencode@next
      • bunx oh-my-opencode@3.0.0-beta.2 install → oh-my-opencode@3.0.0-beta.2
    • Replace existing plugin entries with the new version-aware value to allow switching channels.
    • Prioritize tags when multiple match the same version: latest > beta > next.
    • Fallback to a pinned version on registry/network errors with a 5s timeout.

Written for commit 8395a6e. Summary will update on new commits.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 11, 2026

All contributors have signed the CLA. Thank you! ✅
Posted by the CLA Assistant Lite bot.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files

Confidence score: 3/5

  • Installer currently aborts if any oh-my-opencode plugin entries exist in src/cli/config-manager.ts, so users can’t switch channels or versions and stale plugin definitions persist—this is a real regression risk for updates.
  • Pay close attention to src/cli/config-manager.ts - ensure the installer updates existing plugin entries instead of exiting early.
Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="src/cli/config-manager.ts">

<violation number="1" location="src/cli/config-manager.ts:240">
P1: Installer exits when any oh-my-opencode plugin exists, so it never updates the entry to the requested version/tag, blocking channel/version switches and leaving stale plugin entries.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Previously, the installer always wrote 'oh-my-opencode' without a version,
causing users who installed beta versions (e.g., bunx oh-my-opencode@beta)
to unexpectedly load the stable version on next OpenCode startup.

Now the installer queries npm dist-tags and writes:
- @latest when current version matches the latest tag
- @beta when current version matches the beta tag
- @<version> when no tag matches (pins to specific version)

This ensures:
- bunx oh-my-opencode install → @latest (tracks stable)
- bunx oh-my-opencode@beta install → @beta (tracks beta tag)
- bunx oh-my-opencode@3.0.0-beta.2 install → @3.0.0-beta.2 (pinned)
Addresses cubic review feedback: installer now replaces existing
oh-my-opencode entries with the new version-aware entry, allowing
users to switch between @latest, @beta, or pinned versions.
@aw338WoWmUI aw338WoWmUI force-pushed the fix/installer-version-pinning branch from 6d42cb3 to 1a5fdb3 Compare January 11, 2026 05:03
@aw338WoWmUI
Copy link
Contributor Author

recheck

github-actions bot added a commit that referenced this pull request Jan 11, 2026
kdcokenny pushed a commit that referenced this pull request Jan 13, 2026
@kdcokenny
Copy link
Collaborator

Thanks! This solves a real pain point for our beta users. The implementation is clean and the test coverage is excellent. 👍
A few minor thoughts:

  1. Tag ordering: Object.entries(distTags) iteration order isn't guaranteed. If a version matches multiple tags (e.g., during release promotion when latest and beta temporarily point to the same version), the result could be non-deterministic. Please prioritize the latest explicitly:
      const prioritizedTags = ['latest', 'beta', 'next', ...Object.keys(distTags)]
   for (const tag of prioritizedTags) {
     if (distTags[tag] === currentVersion) {
       return `${PACKAGE_NAME}@${tag}`
     }
   }
  1. Fetch timeout: Might be worth adding signal: AbortSignal.timeout(5000) to avoid blocking installation on slow networks.
  2. Also, I believe that there are some unused imports that should be cleaned up.
  3. Please resolve the merge conflicts

- Prioritize 'latest', 'beta', 'next' tags in getPluginNameWithVersion()
  to ensure deterministic results when version matches multiple tags
- Add 5s timeout to fetchNpmDistTags() to prevent blocking on slow networks
- Remove unused 'join' import from node:path
- Merge upstream/dev and resolve conflicts in config-manager.test.ts
@aw338WoWmUI aw338WoWmUI force-pushed the fix/installer-version-pinning branch from 85409dc to 8395a6e Compare January 14, 2026 22:12
@aw338WoWmUI
Copy link
Contributor Author

recheck

@kdcokenny
Copy link
Collaborator

lgtm, thanks for the contribution! 🚀

@kdcokenny kdcokenny merged commit b1f19cb into code-yeongyu:dev Jan 14, 2026
2 checks passed
sssgun pushed a commit to sssgun/oh-my-opencode that referenced this pull request Jan 18, 2026
sssgun pushed a commit to sssgun/oh-my-opencode that referenced this pull request Jan 18, 2026
…rsion-pinning

fix(cli): write version-aware plugin entry during installation
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.

2 participants