mirror of
https://github.com/eyaltoledano/claude-task-master.git
synced 2025-12-03 18:40:43 +00:00
Ensures that the 'details' field, which can be updated via 'update-subtask', is correctly rendered when viewing a specific subtask. fix(test): Remove empty describe block causing Jest error Removes a redundant block in that contained a hook but no tests. chore: Add npm script
32 lines
1.1 KiB
Plaintext
32 lines
1.1 KiB
Plaintext
async function updateSubtaskById(tasksPath, subtaskId, prompt, useResearch = false) {
|
|
let loadingIndicator = null;
|
|
try {
|
|
log('info', `Updating subtask ${subtaskId} with prompt: "${prompt}"`);
|
|
|
|
// Validate subtask ID format
|
|
if (!subtaskId || typeof subtaskId !== 'string' || !subtaskId.includes('.')) {
|
|
throw new Error(`Invalid subtask ID format: ${subtaskId}. Subtask ID must be in format "parentId.subtaskId"`);
|
|
}
|
|
|
|
// Validate prompt
|
|
if (!prompt || typeof prompt !== 'string' || prompt.trim() === '') {
|
|
throw new Error('Prompt cannot be empty. Please provide context for the subtask update.');
|
|
}
|
|
|
|
// Prepare for fallback handling
|
|
let claudeOverloaded = false;
|
|
|
|
// Validate tasks file exists
|
|
if (!fs.existsSync(tasksPath)) {
|
|
throw new Error(`Tasks file not found at path: ${tasksPath}`);
|
|
}
|
|
|
|
// Read the tasks file
|
|
const data = readJSON(tasksPath);
|
|
// ... rest of the function
|
|
} catch (error) {
|
|
// Handle errors
|
|
console.error(`Error updating subtask: ${error.message}`);
|
|
throw error;
|
|
}
|
|
} |