Skip to content

fix(doctor): fall back to loadedVersion when pluginVersion is null#2596

Merged
acamq merged 1 commit intocode-yeongyu:devfrom
cyberprophet:fix/doctor-plugin-version-fallback
Mar 16, 2026
Merged

fix(doctor): fall back to loadedVersion when pluginVersion is null#2596
acamq merged 1 commit intocode-yeongyu:devfrom
cyberprophet:fix/doctor-plugin-version-fallback

Conversation

@cyberprophet
Copy link
Copy Markdown
Contributor

@cyberprophet cyberprophet commented Mar 16, 2026

Summary

  • Doctor displays oh-my-opencode unknown because pluginVersion has no fallback to loadedVersion
  • Add loadedVersion as third fallback in nullish coalescing chain

Closes #2595

Change

src/cli/doctor/checks/system.ts — 1 line:

- const pluginVersion = pluginInfo.pinnedVersion ?? loadedInfo.expectedVersion
+ const pluginVersion = pluginInfo.pinnedVersion ?? loadedInfo.expectedVersion ?? loadedInfo.loadedVersion

Why

When opencode.json registers the plugin without a version ("oh-my-opencode") and the auto-updater syncs the cache package.json to use "latest" tag, normalizeVersion("latest") returns null because it only matches semver patterns. Meanwhile loadedVersion correctly reads "3.11.2" from node_modules/oh-my-opencode/package.json but is never used for display.


Summary by cubic

Fixes Doctor showing oh-my-opencode unknown by falling back to the loaded plugin version when pinned/expected versions are missing. Ensures the real installed version shows even when opencode.json uses latest.

Written for commit 5b7ca99. Summary will update on new commits.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

Copy link
Copy Markdown

@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.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Auto-approved: Surgical fix for diagnostic display issue; adds fallback to loaded version when others are null. No risk of functional regression.

@acamq
Copy link
Copy Markdown
Collaborator

acamq commented Mar 16, 2026

LGTM! Thank you!

@acamq acamq merged commit 1cfc1c8 into code-yeongyu:dev Mar 16, 2026
7 of 8 checks passed
@cyberprophet cyberprophet deleted the fix/doctor-plugin-version-fallback branch March 16, 2026 02:34
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.

fix(doctor): plugin version shows "unknown" when cache uses dist-tag

2 participants