fix: expand-task (#755)

This commit is contained in:
Ralph Khreish
2025-06-12 21:35:21 +02:00
parent 5ec1f61c13
commit 0849c0c2ce
2 changed files with 10 additions and 2 deletions

View File

@@ -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 || {