chore: run format
This commit is contained in:
@@ -195,14 +195,22 @@ function parseUpdatedTaskFromText(text, expectedTaskId, logFn, isMCP) {
|
|||||||
...parsedTask,
|
...parsedTask,
|
||||||
// Ensure subtasks is an array and each subtask has required fields
|
// Ensure subtasks is an array and each subtask has required fields
|
||||||
subtasks: Array.isArray(parsedTask.subtasks)
|
subtasks: Array.isArray(parsedTask.subtasks)
|
||||||
? parsedTask.subtasks.map(subtask => ({
|
? parsedTask.subtasks.map((subtask) => ({
|
||||||
...subtask,
|
...subtask,
|
||||||
title: subtask.title || '',
|
title: subtask.title || '',
|
||||||
description: subtask.description || '',
|
description: subtask.description || '',
|
||||||
status: subtask.status || 'pending',
|
status: subtask.status || 'pending',
|
||||||
dependencies: Array.isArray(subtask.dependencies) ? subtask.dependencies : [],
|
dependencies: Array.isArray(subtask.dependencies)
|
||||||
details: typeof subtask.details === 'string' ? subtask.details : String(subtask.details || ''),
|
? subtask.dependencies
|
||||||
testStrategy: typeof subtask.testStrategy === 'string' ? subtask.testStrategy : String(subtask.testStrategy || '')
|
: [],
|
||||||
|
details:
|
||||||
|
typeof subtask.details === 'string'
|
||||||
|
? subtask.details
|
||||||
|
: String(subtask.details || ''),
|
||||||
|
testStrategy:
|
||||||
|
typeof subtask.testStrategy === 'string'
|
||||||
|
? subtask.testStrategy
|
||||||
|
: String(subtask.testStrategy || '')
|
||||||
}))
|
}))
|
||||||
: []
|
: []
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ function parseUpdatedTasksFromText(text, expectedCount, logFn, isMCP) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Preprocess tasks to ensure required fields have proper defaults
|
// Preprocess tasks to ensure required fields have proper defaults
|
||||||
const preprocessedTasks = parsedTasks.map(task => ({
|
const preprocessedTasks = parsedTasks.map((task) => ({
|
||||||
...task,
|
...task,
|
||||||
// Ensure subtasks is always an array (not null or undefined)
|
// Ensure subtasks is always an array (not null or undefined)
|
||||||
subtasks: Array.isArray(task.subtasks) ? task.subtasks : [],
|
subtasks: Array.isArray(task.subtasks) ? task.subtasks : [],
|
||||||
@@ -459,7 +459,10 @@ async function updateTasks(
|
|||||||
...task, // Keep all existing fields
|
...task, // Keep all existing fields
|
||||||
...updatedTask, // Override with updated fields
|
...updatedTask, // Override with updated fields
|
||||||
// Ensure subtasks field is preserved if not provided by AI
|
// Ensure subtasks field is preserved if not provided by AI
|
||||||
subtasks: updatedTask.subtasks !== undefined ? updatedTask.subtasks : task.subtasks
|
subtasks:
|
||||||
|
updatedTask.subtasks !== undefined
|
||||||
|
? updatedTask.subtasks
|
||||||
|
: task.subtasks
|
||||||
};
|
};
|
||||||
actualUpdateCount++;
|
actualUpdateCount++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user