diff --git a/.changeset/nasty-chefs-add.md b/.changeset/nasty-chefs-add.md new file mode 100644 index 00000000..304aeb24 --- /dev/null +++ b/.changeset/nasty-chefs-add.md @@ -0,0 +1,8 @@ +--- +"task-master-ai": patch +--- + +Fixes issue with expand CLI command "Complexity report not found" + +- Closes #735 +- Closes #728 diff --git a/scripts/modules/task-manager/expand-task.js b/scripts/modules/task-manager/expand-task.js index 3757067e..2cfb9911 100644 --- a/scripts/modules/task-manager/expand-task.js +++ b/scripts/modules/task-manager/expand-task.js @@ -15,6 +15,7 @@ import { generateTextService } from '../ai-services-unified.js'; import { getDefaultSubtasks, getDebugFlag } from '../config-manager.js'; import generateTaskFiles from './generate-task-files.js'; import { COMPLEXITY_REPORT_FILE } from '../../../src/constants/paths.js'; +import { findProjectRoot } from '../../../src/utils/path-utils.js'; // --- Zod Schemas (Keep from previous step) --- const subtaskSchema = z @@ -417,8 +418,7 @@ async function expandTask( const outputFormat = mcpLog ? 'json' : 'text'; // Determine projectRoot: Use from context if available, otherwise derive from tasksPath - const projectRoot = - contextProjectRoot || path.dirname(path.dirname(tasksPath)); + const projectRoot = contextProjectRoot || findProjectRoot(tasksPath); // Use mcpLog if available, otherwise use the default console log wrapper const logger = mcpLog || {