From baea8652b92dbf0652e616d0dfd4f3b94c8583c7 Mon Sep 17 00:00:00 2001 From: Brian Madison Date: Tue, 7 Apr 2026 02:18:23 -0500 Subject: [PATCH] fix(installer): resolve module source before reading marketplace version Move _readMarketplaceVersion call after source type resolution so custom modules use their own source path instead of falling back to the external module cache, which could match a different module with the same code. --- tools/installer/core/manifest.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/installer/core/manifest.js b/tools/installer/core/manifest.js index 3da5ad7d3..287b38918 100644 --- a/tools/installer/core/manifest.js +++ b/tools/installer/core/manifest.js @@ -837,14 +837,11 @@ class Manifest { * @returns {Object} Version info object with version, source, npmPackage, repoUrl */ async getModuleVersionInfo(moduleName, bmadDir, moduleSourcePath = null) { - const os = require('node:os'); const yaml = require('yaml'); - // All module versions come from .claude-plugin/marketplace.json - const version = await this._readMarketplaceVersion(moduleName, moduleSourcePath); - - // Determine source type + // Resolve source type first, then read version with the correct path context if (['core', 'bmm'].includes(moduleName)) { + const version = await this._readMarketplaceVersion(moduleName, moduleSourcePath); return { version, source: 'built-in', @@ -859,6 +856,8 @@ class Manifest { const moduleInfo = await extMgr.getModuleByCode(moduleName); if (moduleInfo) { + // External module: use moduleSourcePath if provided, otherwise fall back to cache + const version = await this._readMarketplaceVersion(moduleName, moduleSourcePath); return { version, source: 'external', @@ -867,7 +866,10 @@ class Manifest { }; } - // Custom module - check cache directory + // Custom module: resolve path from source or cache before reading version + const customSourcePath = moduleSourcePath || path.join(bmadDir, '_config', 'custom', moduleName); + const version = await this._readMarketplaceVersion(moduleName, customSourcePath); + const cacheDir = path.join(bmadDir, '_config', 'custom', moduleName); const moduleYamlPath = path.join(cacheDir, 'module.yaml');