File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
ui/src/components/executions Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 378378 const attemptNumber = this .selectedAttemptNumberByTaskRunId [taskRun .id ] ?? 0 ;
379379 const attemptUid = this .attemptUid (taskRun .id , attemptNumber);
380380 const logs = this .logsWithIndexByAttemptUid [attemptUid] ?? [];
381- const errorLine = (() => {
382- const lastError = [ ... logs]. reverse (). find ( l => (l .level || " " ).toString ().toUpperCase () === " ERROR" );
383- if (lastError ? . message ) return lastError . message ;
381+ const errorLines = (() => {
382+ const errors = logs . filter ( l => (l .level || " " ).toString ().toUpperCase () === " ERROR" && ( l . message ?? " " ). length > 0 );
383+ if (errors . length > 0 ) return errors . map ( l => l . message ). join ( " \n " ) ;
384384 const last = [... logs].reverse ().find (l => (l .message ?? " " ).length > 0 );
385385 return last? .message ?? " " ;
386386 })();
387- const prompt = ` Fix the task ${ taskRun .taskId } as it generated the following error:\n ${ errorLine } ` ;
387+ const prompt = ` Fix the task ${ taskRun .taskId } as it generated the following error:\n ${ errorLines } ` ;
388388 try {
389389 window .sessionStorage .setItem (" kestra-ai-prompt" , prompt);
390390 } catch (err) {
You can’t perform that action at this time.
0 commit comments