Skip to content

Commit 77cc5e4

Browse files
mm-parthyCrunchyman-ralph
authored andcommitted
Fix: Correct tag handling for expand --all and show commands (#1026)
Fix: Correct tag handling for expand --all and show commands
1 parent d31ef7a commit 77cc5e4

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

.changeset/fresh-bugs-squashed.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"task-master-ai": patch
3+
---
4+
5+
Fix 'expand --all' and 'show' commands to correctly handle tag contexts for complexity reports and task display.

scripts/modules/commands.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2381,7 +2381,8 @@ ${result.result}
23812381
.action(async (taskId, options) => {
23822382
// Initialize TaskMaster
23832383
const initOptions = {
2384-
tasksPath: options.file || true
2384+
tasksPath: options.file || true,
2385+
tag: options.tag
23852386
};
23862387
// Only pass complexityReportPath if user provided a custom path
23872388
if (options.report && options.report !== COMPLEXITY_REPORT_FILE) {
@@ -4483,11 +4484,13 @@ Examples:
44834484
TASKMASTER_TASKS_FILE
44844485
)
44854486
.option('--show-metadata', 'Show detailed metadata for each tag')
4487+
.option('--tag <tag>', 'Specify tag context for task operations')
44864488
.action(async (options) => {
44874489
try {
44884490
// Initialize TaskMaster
44894491
const taskMaster = initTaskMaster({
4490-
tasksPath: options.file || true
4492+
tasksPath: options.file || true,
4493+
tag: options.tag
44914494
});
44924495
const tasksPath = taskMaster.getTasksPath();
44934496

scripts/modules/task-manager/expand-all-tasks.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import boxen from 'boxen';
2222
* @param {Object} [context.mcpLog] - MCP logger object.
2323
* @param {string} [context.projectRoot] - Project root path
2424
* @param {string} [context.tag] - Tag for the task
25+
* @param {string} [context.complexityReportPath] - Path to the complexity report file
2526
* @param {string} [outputFormat='text'] - Output format ('text' or 'json'). MCP calls should use 'json'.
2627
* @returns {Promise<{success: boolean, expandedCount: number, failedCount: number, skippedCount: number, tasksToExpand: number, telemetryData: Array<Object>}>} - Result summary.
2728
*/
@@ -34,7 +35,13 @@ async function expandAllTasks(
3435
context = {},
3536
outputFormat = 'text' // Assume text default for CLI
3637
) {
37-
const { session, mcpLog, projectRoot: providedProjectRoot, tag } = context;
38+
const {
39+
session,
40+
mcpLog,
41+
projectRoot: providedProjectRoot,
42+
tag,
43+
complexityReportPath
44+
} = context;
3845
const isMCPCall = !!mcpLog; // Determine if called from MCP
3946

4047
const projectRoot = providedProjectRoot || findProjectRoot();
@@ -126,7 +133,12 @@ async function expandAllTasks(
126133
numSubtasks,
127134
useResearch,
128135
additionalContext,
129-
{ ...context, projectRoot, tag: data.tag || tag }, // Pass the whole context object with projectRoot and resolved tag
136+
{
137+
...context,
138+
projectRoot,
139+
tag: data.tag || tag,
140+
complexityReportPath
141+
}, // Pass the whole context object with projectRoot and resolved tag
130142
force
131143
);
132144
expandedCount++;

0 commit comments

Comments
 (0)