Skip to content

fix(plugin-config): ensure both legacy and renamed config files are discovered (fixes #3133)#3431

Open
MoerAI wants to merge 1 commit intocode-yeongyu:devfrom
MoerAI:fix/config-migration-consistency
Open

fix(plugin-config): ensure both legacy and renamed config files are discovered (fixes #3133)#3431
MoerAI wants to merge 1 commit intocode-yeongyu:devfrom
MoerAI:fix/config-migration-consistency

Conversation

@MoerAI
Copy link
Copy Markdown
Contributor

@MoerAI MoerAI commented Apr 14, 2026

Summary

  • make shared plugin config path discovery resolve whichever oh-my-openagent or oh-my-opencode config file actually exists
  • add regression coverage for legacy-only detection and canonical-over-legacy precedence in shared config path resolution

Problem

Some code paths still treated the plugin config path as a fixed canonical oh-my-openagent.json fallback instead of resolving the active file on disk. That made discovery inconsistent when users only had a legacy oh-my-opencode.json[c] file or a .jsonc variant, even though the loader itself supports both basenames during the rename transition.

Fix

Update getOpenCodeConfigPaths() to use detectPluginConfigFile() so shared path resolution consistently returns the real active plugin config file across old/new basenames and .json/.jsonc extensions. Add regression tests to lock in legacy fallback behavior and canonical-name precedence when both variants are present.

Changes

File Change
src/shared/opencode-config-dir.ts Resolve omoConfig from detected plugin config files instead of a fixed canonical .json path
src/shared/opencode-config-dir.test.ts Add regression tests for legacy-only detection and canonical precedence

Fixes #3133


Summary by cubic

Ensure plugin config discovery resolves the actual file on disk, whether legacy oh-my-opencode or renamed oh-my-openagent, across .json/.jsonc. Canonical is preferred when both exist. Fixes #3133.

  • Bug Fixes
    • Update getOpenCodeConfigPaths() to use detectPluginConfigFile() and set omoConfig to the detected path, preferring oh-my-openagent when both variants exist.
    • Add regression tests for legacy-only detection and canonical-over-legacy precedence.

Written for commit dacaeb4. Summary will update on new commits.

@MoerAI
Copy link
Copy Markdown
Contributor Author

MoerAI commented Apr 14, 2026

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

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 2 files

Confidence score: 5/5

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

Auto-approved: Fixes config discovery inconsistency by using existing detection utility and adds comprehensive regression tests for legacy/canonical precedence.

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.

[Bug]: v3.15.1 still inconsistently loads/migrates plugin config after rename

1 participant