eyaltoledano/claude-task-master · error

CORE_FUNCTION_ERROR

CORE_FUNCTION_ERROR

Error message

result?.message || 'Core function failed to update tasks or returned unexpected result.'

What it means

After calling core updateTasks, the wrapper expects { success: true, updatedTasks: [...] }. If the result is missing, unsuccessful, or shaped unexpectedly, it returns CORE_FUNCTION_ERROR using the core's message when available, else a generic fallback. This is a contract mismatch between the wrapper and the core function rather than a thrown exception.

Source

Thrown at mcp-server/src/core/direct-functions/update-tasks.js:112

			return {
				success: true,
				data: {
					message: `Successfully updated ${result.updatedTasks.length} tasks.`,
					tasksPath: tasksJsonPath,
					updatedCount: result.updatedTasks.length,
					telemetryData: result.telemetryData,
					tagInfo: result.tagInfo
				}
			};
		} else {
			// Handle case where core function didn't return expected success structure
			logWrapper.error(
				'Core updateTasks function did not return a successful structure.'
			);
			return {
				success: false,
				error: {
					code: 'CORE_FUNCTION_ERROR',
					message:
						result?.message ||
						'Core function failed to update tasks or returned unexpected result.'
				}
			};
		}
	} catch (error) {
		logWrapper.error(`Error executing core updateTasks: ${error.message}`);
		return {
			success: false,
			error: {
				code: 'UPDATE_TASKS_CORE_ERROR',
				message: error.message || 'Unknown error updating tasks'
			}
		};
	} finally {
		disableSilentMode(); // Ensure silent mode is disabled
	}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Read result.message surfaced in the error for the core-side cause
  2. Verify the 'from' id exists and there are tasks at/after it (task-master list)
  3. Check API keys/provider health if the message indicates an AI failure
  4. Align @tm/core / scripts task-manager versions — a result-shape mismatch indicates version drift
Defensive patterns

Strategy: fallback

Validate before calling

const tasks = JSON.parse(readFileSync(tasksPath, 'utf8')).tasks;
const fromNum = parseInt(String(args.from), 10);
if (Number.isNaN(fromNum) || !tasks.some(t => t.id >= fromNum)) {
  console.error(`No tasks at or after id ${args.from}; nothing to update`);
}

Try / catch

const result = await updateTasksDirect(args, log);
if (!result.success && result.error.code === 'CORE_FUNCTION_ERROR') {
  console.error(`Core update failed: ${result.error.message}`);
  // fallback: retry with a smaller scope or fix the cause (id range, API key) before retrying
}

Prevention

When it happens

Trigger: Core updateTasks returns { success: false, message } (e.g. AI API failure reported gracefully, no tasks matched the 'from' id), or returns null/undefined/an object without updatedTasks.

Common situations: AI provider errors surfaced as a soft-fail result; starting id greater than all task ids so nothing was updated; core version drift where the result shape changed; internal core validation returning success:false with a message.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/b97eb210197c84fd. Report an issue: GitHub.