Fix workflow MCP bundled CLI lookup in tests

This commit is contained in:
Jeremy 2026-04-09 17:50:01 -05:00
parent c19830b702
commit b573af4828

View file

@ -70,10 +70,16 @@ function lookupCommand(command: string, platform: NodeJS.Platform = process.plat
function getBundledWorkflowMcpCliPath(env: NodeJS.ProcessEnv): string | null {
if (!env.GSD_BIN_PATH?.trim() && !env.GSD_CLI_PATH?.trim()) return null;
const bundledCli = resolve(
fileURLToPath(new URL("../../../../packages/mcp-server/dist/cli.js", import.meta.url)),
);
return existsSync(bundledCli) ? bundledCli : null;
const candidates = [
resolve(fileURLToPath(new URL("../../../../packages/mcp-server/dist/cli.js", import.meta.url))),
resolve(fileURLToPath(new URL("../../../../../packages/mcp-server/dist/cli.js", import.meta.url))),
];
for (const bundledCli of candidates) {
if (existsSync(bundledCli)) return bundledCli;
}
return null;
}
export function detectWorkflowMcpLaunchConfig(