Fix: Correct tag handling for expand --all and show commands (#1026)

Fix: Correct tag handling for expand --all and show commands
This commit is contained in:
Parthy
2025-07-21 17:35:29 +02:00
committed by Ralph Khreish
parent d31ef7a39c
commit 77cc5e4537
3 changed files with 24 additions and 4 deletions

View File

@@ -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 MCP
const 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 tag
force
);
expandedCount++;