Skip to content

fix(doctor): prefer config dir for loaded plugin version#2364

Merged
code-yeongyu merged 2 commits intodevfrom
fix/issue-2240
Mar 11, 2026
Merged

fix(doctor): prefer config dir for loaded plugin version#2364
code-yeongyu merged 2 commits intodevfrom
fix/issue-2240

Conversation

@code-yeongyu
Copy link
Owner

@code-yeongyu code-yeongyu commented Mar 7, 2026

Summary

  • check the OpenCode config install before the legacy cache install when resolving the loaded plugin version
  • fall back to the cache install path when the config directory does not contain the plugin package
  • add regression tests for config-dir precedence and legacy cache fallback

Testing

  • bun test src/cli/doctor/
  • bun run typecheck
  • bun run build

Summary by cubic

Fixes doctor version detection to prefer the OpenCode config directory and fall back to the legacy cache, so bun-based installs report the correct loaded plugin version.

  • Bug Fixes
    • Prefer OPENCODE_CONFIG_DIR; fall back to XDG_CACHE_HOME.
    • Tests: add config-dir precedence and legacy fallback; isolate module import to prevent CI mock leaks.

Written for commit 26ae247. Summary will update on new commits.

Check the OpenCode config install before the legacy cache install so doctor reports the actual loaded plugin version for bun-based installs.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <[email protected]>
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.

No issues found across 2 files

Confidence score: 5/5

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

Auto-approved: The PR correctly implements precedence logic and fallback for plugin version detection in the doctor command, backed by thorough regression tests and no risk to core functionality.

Load the doctor loaded-version module through a unique test-only specifier so Bun module mocks from system tests cannot leak into the real module assertions in CI.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <[email protected]>
@code-yeongyu code-yeongyu merged commit 398b556 into dev Mar 11, 2026
8 checks passed
@code-yeongyu code-yeongyu deleted the fix/issue-2240 branch March 11, 2026 09:29
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