{"record":{"id":"e13684f452b55b5d","repo":"ruvnet/ruflo","slug":"task-failed","errorCode":"TASK_FAILED","errorMessage":"Task failed to complete","messagePattern":"Task failed to complete","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/mcp/tools/task-tools.ts","lineNumber":856,"sourceCode":"  }\n\n  // Check if task has results\n  const result = taskResults.get(input.taskId);\n  if (result) {\n    return {\n      ...result,\n      artifacts: input.includeArtifacts ? result.artifacts : undefined,\n    };\n  }\n\n  // Task exists but no results yet\n  return {\n    taskId: input.taskId,\n    status: task.status,\n    success: task.status === 'completed',\n    output: undefined,\n    error: task.status === 'failed' ? {\n      code: 'TASK_FAILED',\n      message: 'Task failed to complete',\n    } : undefined,\n    completedAt: task.completedAt,\n  };\n}\n\n// ============================================================================\n// Tool Definitions\n// ============================================================================\n\n/**\n * tasks/create tool\n */\nexport const createTaskTool: MCPTool = {\n  name: 'tasks/create',\n  description: 'Create a new task for execution with specified type, priority, and configuration',\n  inputSchema: {\n    type: 'object',","sourceCodeStart":838,"sourceCodeEnd":874,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/mcp/tools/task-tools.ts#L838-L874","documentation":"handleTaskResults() found the task exists but has no stored result entry and its terminal status is 'failed' (not completed). TASK_FAILED sentinel: the referenced task finished unsuccessfully, so no output payload exists to return; the failure detail lives in the task's own record/logs.","triggerScenarios":"Thrown at v3/mcp/tools/task-tools.ts:856 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the task's underlying error and logs; fix the failing step and retry the task.","Add per-step error capture so the failing step's diagnostic is propagated to the caller."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}