{"record":{"id":"b97eb210197c84fd","repo":"eyaltoledano/claude-task-master","slug":"core-function-error-b97eb2","errorCode":"CORE_FUNCTION_ERROR","errorMessage":"result?.message || 'Core function failed to update tasks or returned unexpected result.'","messagePattern":"result\\?\\.message \\|\\| 'Core function failed to update tasks or returned unexpected result\\.'","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"mcp-server/src/core/direct-functions/update-tasks.js","lineNumber":112,"sourceCode":"\t\t\treturn {\n\t\t\t\tsuccess: true,\n\t\t\t\tdata: {\n\t\t\t\t\tmessage: `Successfully updated ${result.updatedTasks.length} tasks.`,\n\t\t\t\t\ttasksPath: tasksJsonPath,\n\t\t\t\t\tupdatedCount: result.updatedTasks.length,\n\t\t\t\t\ttelemetryData: result.telemetryData,\n\t\t\t\t\ttagInfo: result.tagInfo\n\t\t\t\t}\n\t\t\t};\n\t\t} else {\n\t\t\t// Handle case where core function didn't return expected success structure\n\t\t\tlogWrapper.error(\n\t\t\t\t'Core updateTasks function did not return a successful structure.'\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tsuccess: false,\n\t\t\t\terror: {\n\t\t\t\t\tcode: 'CORE_FUNCTION_ERROR',\n\t\t\t\t\tmessage:\n\t\t\t\t\t\tresult?.message ||\n\t\t\t\t\t\t'Core function failed to update tasks or returned unexpected result.'\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t} catch (error) {\n\t\tlogWrapper.error(`Error executing core updateTasks: ${error.message}`);\n\t\treturn {\n\t\t\tsuccess: false,\n\t\t\terror: {\n\t\t\t\tcode: 'UPDATE_TASKS_CORE_ERROR',\n\t\t\t\tmessage: error.message || 'Unknown error updating tasks'\n\t\t\t}\n\t\t};\n\t} finally {\n\t\tdisableSilentMode(); // Ensure silent mode is disabled\n\t}","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/mcp-server/src/core/direct-functions/update-tasks.js#L94-L130","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Read result.message surfaced in the error for the core-side cause","Verify the 'from' id exists and there are tasks at/after it (task-master list)","Check API keys/provider health if the message indicates an AI failure","Align @tm/core / scripts task-manager versions — a result-shape mismatch indicates version drift"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"const tasks = JSON.parse(readFileSync(tasksPath, 'utf8')).tasks;\nconst fromNum = parseInt(String(args.from), 10);\nif (Number.isNaN(fromNum) || !tasks.some(t => t.id >= fromNum)) {\n  console.error(`No tasks at or after id ${args.from}; nothing to update`);\n}","typeGuard":null,"tryCatchPattern":"const result = await updateTasksDirect(args, log);\nif (!result.success && result.error.code === 'CORE_FUNCTION_ERROR') {\n  console.error(`Core update failed: ${result.error.message}`);\n  // fallback: retry with a smaller scope or fix the cause (id range, API key) before retrying\n}","preventionTips":["Verify the from id exists and there are tasks at/after it","Keep the core task-manager and MCP wrapper versions in sync","Monitor result.message — the core reports soft failures there instead of throwing"],"tags":["core-function","contract-mismatch","mcp"],"backgroundTag":"core-function-failed","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}