fix: prefer canonical plugin config files

This commit is contained in:
YeonGyu-Kim
2026-04-03 17:15:08 +09:00
parent 88b84a8517
commit b096e6f751
2 changed files with 31 additions and 6 deletions
+14
View File
@@ -177,6 +177,13 @@ export function loadPluginConfig(
? userDetected.path
: path.join(configDir, "oh-my-opencode.json");
if (userDetected.legacyPath) {
log("Canonical plugin config detected alongside legacy config. Remove the legacy file to avoid confusion.", {
canonicalPath: userDetected.path,
legacyPath: userDetected.legacyPath,
});
}
// Auto-copy legacy config file to canonical name if needed
if (userDetected.format !== "none" && path.basename(userDetected.path).startsWith(LEGACY_CONFIG_BASENAME)) {
migrateLegacyConfigFile(userDetected.path);
@@ -190,6 +197,13 @@ export function loadPluginConfig(
? projectDetected.path
: path.join(projectBasePath, "oh-my-opencode.json");
if (projectDetected.legacyPath) {
log("Canonical plugin config detected alongside legacy config. Remove the legacy file to avoid confusion.", {
canonicalPath: projectDetected.path,
legacyPath: projectDetected.legacyPath,
});
}
// Auto-copy legacy project config file to canonical name if needed
if (projectDetected.format !== "none" && path.basename(projectDetected.path).startsWith(LEGACY_CONFIG_BASENAME)) {
migrateLegacyConfigFile(projectDetected.path);