Skip to content

Conversation

@aw338WoWmUI
Copy link

@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 [email protected] 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 [email protected] 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 [email protected] install → [email protected]
    • Replace existing plugin entries with the new version-aware value to allow switching channels.
    • Fallback to a pinned version on registry/network errors.

Written for commit 1a5fdb3. 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 [email protected] 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
Author

recheck

github-actions bot added a commit that referenced this pull request Jan 11, 2026
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