@@ -152,12 +152,12 @@ function PinnedLogs({
152152 executionData,
153153 blockId,
154154 workflowState,
155- onClose
155+ onClose,
156156} : {
157- executionData : any | null ;
158- blockId : string ;
159- workflowState : any ;
160- onClose : ( ) => void ;
157+ executionData : any | null
158+ blockId : string
159+ workflowState : any
160+ onClose : ( ) => void
161161} ) {
162162 // ALL HOOKS MUST BE CALLED BEFORE ANY CONDITIONAL RETURNS
163163 const [ currentIterationIndex , setCurrentIterationIndex ] = useState ( 0 )
@@ -197,9 +197,7 @@ function PinnedLogs({
197197 </ div >
198198 < div className = 'flex items-center justify-between' >
199199 < div className = 'flex items-center gap-2' >
200- < Badge variant = 'secondary' >
201- { formatted . blockType }
202- </ Badge >
200+ < Badge variant = 'secondary' > { formatted . blockType } </ Badge >
203201 < Badge variant = 'outline' > not executed</ Badge >
204202 </ div >
205203 </ div >
@@ -435,67 +433,67 @@ export function FrozenCanvas({
435433
436434 logger . debug ( 'Grouped trace spans by blockId:' , traceSpansByBlockId )
437435
438- for ( const [ blockId , spans ] of Object . entries ( traceSpansByBlockId ) ) {
439- const spanArray = spans as any [ ]
440-
441- const iterations = spanArray . map ( ( span : any ) => {
442- // Extract error information from span output if status is error
443- let errorMessage = null
444- let errorStackTrace = null
445-
446- if ( span . status === 'error' && span . output ) {
447- // Error information can be in different formats in the output
448- if ( typeof span . output === 'string' ) {
449- errorMessage = span . output
450- } else if ( span . output . error ) {
451- errorMessage = span . output . error
452- errorStackTrace = span . output . stackTrace || span . output . stack
453- } else if ( span . output . message ) {
454- errorMessage = span . output . message
455- errorStackTrace = span . output . stackTrace || span . output . stack
456- } else {
457- // Fallback: stringify the entire output for error cases
458- errorMessage = JSON . stringify ( span . output )
459- }
436+ for ( const [ blockId , spans ] of Object . entries ( traceSpansByBlockId ) ) {
437+ const spanArray = spans as any [ ]
438+
439+ const iterations = spanArray . map ( ( span : any ) => {
440+ // Extract error information from span output if status is error
441+ let errorMessage = null
442+ let errorStackTrace = null
443+
444+ if ( span . status === 'error' && span . output ) {
445+ // Error information can be in different formats in the output
446+ if ( typeof span . output === 'string' ) {
447+ errorMessage = span . output
448+ } else if ( span . output . error ) {
449+ errorMessage = span . output . error
450+ errorStackTrace = span . output . stackTrace || span . output . stack
451+ } else if ( span . output . message ) {
452+ errorMessage = span . output . message
453+ errorStackTrace = span . output . stackTrace || span . output . stack
454+ } else {
455+ // Fallback: stringify the entire output for error cases
456+ errorMessage = JSON . stringify ( span . output )
460457 }
458+ }
461459
462- return {
463- id : span . id ,
464- blockId : span . blockId ,
465- blockName : span . name ,
466- blockType : span . type ,
467- status : span . status ,
468- startedAt : span . startTime ,
469- endedAt : span . endTime ,
470- durationMs : span . duration ,
471- inputData : span . input ,
472- outputData : span . output ,
473- errorMessage,
474- errorStackTrace,
475- cost : span . cost || {
476- input : null ,
477- output : null ,
478- total : null ,
479- } ,
480- tokens : span . tokens || {
481- prompt : null ,
482- completion : null ,
483- total : null ,
484- } ,
485- modelUsed : span . model || null ,
486- metadata : { } ,
487- }
488- } )
489-
490- blockExecutionMap [ blockId ] = {
491- iterations,
492- currentIteration : 0 ,
493- totalIterations : iterations . length ,
460+ return {
461+ id : span . id ,
462+ blockId : span . blockId ,
463+ blockName : span . name ,
464+ blockType : span . type ,
465+ status : span . status ,
466+ startedAt : span . startTime ,
467+ endedAt : span . endTime ,
468+ durationMs : span . duration ,
469+ inputData : span . input ,
470+ outputData : span . output ,
471+ errorMessage,
472+ errorStackTrace,
473+ cost : span . cost || {
474+ input : null ,
475+ output : null ,
476+ total : null ,
477+ } ,
478+ tokens : span . tokens || {
479+ prompt : null ,
480+ completion : null ,
481+ total : null ,
482+ } ,
483+ modelUsed : span . model || null ,
484+ metadata : { } ,
494485 }
495- }
486+ } )
496487
497- setBlockExecutions ( blockExecutionMap )
488+ blockExecutionMap [ blockId ] = {
489+ iterations,
490+ currentIteration : 0 ,
491+ totalIterations : iterations . length ,
492+ }
498493 }
494+
495+ setBlockExecutions ( blockExecutionMap )
496+ }
499497 } , [ traceSpans ] )
500498
501499 useEffect ( ( ) => {
0 commit comments