An AI-powered task-management system you can drop into Cursor, Lovable, Windsurf, Roo, and others.
JavaScript aicursorcursor-aicursorailovablelovable-devroocodetask-managertaskstasks-listwindsurfwindsurf-ai
Fix: Correct tag handling for expand --all and show commands (#1026)
Parthy77cc5e453739
diff --git a/.changeset/fresh-bugs-squashed.md b/.changeset/fresh-bugs-squashed.mdnew file mode 100644index 00000000..a691a67a--- /dev/null+++ b/.changeset/fresh-bugs-squashed.md@@ -0,0 +1,5 @@+---+"task-master-ai": patch+---++Fix 'expand --all' and 'show' commands to correctly handle tag contexts for complexity reports and task display.\ No newline at end of filediff --git a/scripts/modules/commands.js b/scripts/modules/commands.jsindex 25469ee5..f2b9441f 100644--- a/scripts/modules/commands.js+++ b/scripts/modules/commands.js@@ -2381,7 +2381,8 @@ ${result.result}.action(async (taskId, options) => {// Initialize TaskMasterconst initOptions = {- tasksPath: options.file || true+ tasksPath: options.file || true,+ tag: options.tag};// Only pass complexityReportPath if user provided a custom pathif (options.report && options.report !== COMPLEXITY_REPORT_FILE) {@@ -4483,11 +4484,13 @@ Examples:TASKMASTER_TASKS_FILE).option('--show-metadata', 'Show detailed metadata for each tag')+ .option('--tag <tag>', 'Specify tag context for task operations').action(async (options) => {try {// Initialize TaskMasterconst taskMaster = initTaskMaster({- tasksPath: options.file || true+ tasksPath: options.file || true,+ tag: options.tag});const tasksPath = taskMaster.getTasksPath();diff --git a/scripts/modules/task-manager/expand-all-tasks.js b/scripts/modules/task-manager/expand-all-tasks.jsindex 8e5a2255..3f966897 100644--- a/scripts/modules/task-manager/expand-all-tasks.js+++ b/scripts/modules/task-manager/expand-all-tasks.js@@ -22,6 +22,7 @@ import boxen from 'boxen';* @param {Object} [context.mcpLog] - MCP logger object.* @param {string} [context.projectRoot] - Project root path* @param {string} [context.tag] - Tag for the task+ * @param {string} [context.complexityReportPath] - Path to the complexity report file* @param {string} [outputFormat='text'] - Output format ('text' or 'json'). MCP calls should use 'json'.* @returns {Promise<{success: boolean, expandedCount: number, failedCount: number, skippedCount: number, tasksToExpand: number, telemetryData: Array<Object>}>} - Result summary.*/@@ -34,7 +35,13 @@ async function expandAllTasks(context = {},outputFormat = 'text' // Assume text default for CLI) {- const { session, mcpLog, projectRoot: providedProjectRoot, tag } = context;+ const {+ session,+ mcpLog,+ projectRoot: providedProjectRoot,+ tag,+ complexityReportPath+ } = context;const isMCPCall = !!mcpLog; // Determine if called from MCPconst projectRoot = providedProjectRoot || findProjectRoot();@@ -126,7 +133,12 @@ async function expandAllTasks(numSubtasks,useResearch,additionalContext,- { ...context, projectRoot, tag: data.tag || tag }, // Pass the whole context object with projectRoot and resolved tag+ {+ ...context,+ projectRoot,+ tag: data.tag || tag,+ complexityReportPath+ }, // Pass the whole context object with projectRoot and resolved tagforce);expandedCount++;