@@ -574,30 +574,46 @@ def _process_task_execution_summary(self, task_name: str):
574574 continue # Skip items not assigned to this shard
575575
576576 status = payload .get ('status' , 'PENDING' )
577- if status == 'PASS' :
577+ # Normalize status to PASS/FAIL format
578+ if status in ['PASS' , 'success' ]:
578579 processed_items += 1
579- elif status == 'FAIL' :
580+ status = 'PASS' # Normalize for counting
581+ elif status in ['FAIL' , 'error' , 'failed' ]:
580582 failed_items += 1
583+ status = 'FAIL' # Normalize for counting
584+
585+ # Extract identifiers from the actual data structure
586+ # For GitHub repo fetching, use repo name as the main identifier
587+ repo_name = payload .get ('name' , '' )
588+ repo_url = payload .get ('url' , '' )
581589
582- # Extract call ID from different possible fields
583- call_id = (payload .get ('callid' ) or
584- payload .get ('contact_id' ) or
585- payload .get ('call_id' ) or
586- item .get ('id' , '' ))
590+ # Use repo name as call_id and work_item_id since that's the unique identifier
591+ call_id = repo_name or repo_url or f"item-{ item_count } "
592+ work_item_id = call_id
593+
594+ # Convert status to expected format (PASS/FAIL instead of success/error)
595+ if status == 'success' :
596+ status = 'PASS'
597+ elif status in ['error' , 'failed' ]:
598+ status = 'FAIL'
599+ else :
600+ status = status .upper ()
587601
588602 # Add to work_items data
589603 self .consolidated_data ['work_items' ].append ({
590604 'task_name' : task_name ,
591- 'work_item_id' : item . get ( 'id' , '' ) or payload . get ( 'id' , '' ) ,
605+ 'work_item_id' : work_item_id ,
592606 'call_id' : call_id ,
593607 'status' : status ,
594- 'original_file' : payload . get ( 'original_input_filename' , '' ) ,
608+ 'original_file' : repo_url ,
595609 'error_message' : payload .get ('error' , '' ),
596610 'retry_attempted' : payload .get ('retry_attempted' , False ),
597611 'processing_time_ms' : payload .get ('processing_time_ms' ),
598612 'screenshot_paths' : payload .get ('screenshot_links' , []),
599613 'timestamp' : datetime .now ().isoformat ()
600614 })
615+
616+ item_count += 1
601617
602618 # Add task execution summary
603619 self .consolidated_data ['task_executions' ].append ({
0 commit comments