@@ -537,12 +537,57 @@ def _serialize_justification(
537537
538538 return justification
539539
540- def _extract_agent_snapshot (self , entrypoint : str ) -> StudioWebAgentSnapshot :
540+ def _extract_agent_snapshot (self , entrypoint : str | None ) -> StudioWebAgentSnapshot :
541+ """Extract agent snapshot from entry points configuration or low-code agent file.
542+
543+ For coded agents, reads from entry-points.json configuration file.
544+ For low-code agents (*.json files like agent.json), reads inputSchema
545+ and outputSchema directly from the agent file.
546+
547+ Args:
548+ entrypoint: The entrypoint file path to look up
549+
550+ Returns:
551+ StudioWebAgentSnapshot with input and output schemas
552+ """
553+ if not entrypoint :
554+ logger .warning (
555+ "Entrypoint not provided - falling back to empty inputSchema "
556+ "and outputSchema"
557+ )
558+ return StudioWebAgentSnapshot (input_schema = {}, output_schema = {})
559+
541560 try :
561+ # Check if entrypoint is a low-code agent JSON file (e.g., agent.json)
562+ if entrypoint .endswith (".json" ):
563+ agent_file_path = os .path .join (os .getcwd (), entrypoint )
564+ if os .path .exists (agent_file_path ):
565+ with open (agent_file_path , "r" ) as f :
566+ agent_data = json .load (f )
567+
568+ # Low-code agent files have inputSchema and outputSchema at root
569+ input_schema = agent_data .get ("inputSchema" , {})
570+ output_schema = agent_data .get ("outputSchema" , {})
571+
572+ logger .debug (
573+ f"Extracted agent snapshot from low-code agent '{ entrypoint } ': "
574+ f"inputSchema={ json .dumps (input_schema )} , "
575+ f"outputSchema={ json .dumps (output_schema )} "
576+ )
577+
578+ return StudioWebAgentSnapshot (
579+ input_schema = input_schema , output_schema = output_schema
580+ )
581+
582+ # Fall back to entry-points.json for coded agents
542583 entry_points_file_path = os .path .join (
543584 os .getcwd (), str (UiPathConfig .entry_points_file_path )
544585 )
545586 if not os .path .exists (entry_points_file_path ):
587+ logger .debug (
588+ f"Entry points file not found at { entry_points_file_path } , "
589+ "using empty schemas"
590+ )
546591 return StudioWebAgentSnapshot (input_schema = {}, output_schema = {})
547592
548593 with open (entry_points_file_path , "r" ) as f :
@@ -563,6 +608,12 @@ def _extract_agent_snapshot(self, entrypoint: str) -> StudioWebAgentSnapshot:
563608 input_schema = ep .get ("input" , {})
564609 output_schema = ep .get ("output" , {})
565610
611+ logger .debug (
612+ f"Extracted agent snapshot for entrypoint '{ entrypoint } ': "
613+ f"inputSchema={ json .dumps (input_schema )} , "
614+ f"outputSchema={ json .dumps (output_schema )} "
615+ )
616+
566617 return StudioWebAgentSnapshot (
567618 input_schema = input_schema , output_schema = output_schema
568619 )
@@ -724,6 +775,14 @@ def _update_eval_run_spec(
724775 # Both coded and legacy send payload directly at root level
725776 payload = inner_payload
726777
778+ # Log the payload for debugging eval run updates
779+ agent_type = "coded" if is_coded else "low-code"
780+ logger .debug (
781+ f"Updating eval run (type={ agent_type } ): "
782+ f"evalRunId={ eval_run_id } , success={ success } "
783+ )
784+ logger .debug (f"Full eval run update payload: { json .dumps (payload , indent = 2 )} " )
785+
727786 return RequestSpec (
728787 method = "PUT" ,
729788 endpoint = Endpoint (
@@ -762,6 +821,16 @@ def _update_coded_eval_run_spec(
762821 "evaluatorRuns" : evaluator_runs ,
763822 }
764823
824+ # Log the payload for debugging coded eval run updates
825+ agent_type = "coded" if is_coded else "low-code"
826+ logger .debug (
827+ f"Updating coded eval run (type={ agent_type } ): "
828+ f"evalRunId={ eval_run_id } , success={ success } "
829+ )
830+ logger .debug (
831+ f"Full coded eval run update payload: { json .dumps (payload , indent = 2 )} "
832+ )
833+
765834 return RequestSpec (
766835 method = "PUT" ,
767836 endpoint = Endpoint (
@@ -826,6 +895,14 @@ def _create_eval_run_spec(
826895 # Both coded and legacy send payload directly at root level
827896 payload = inner_payload
828897
898+ # Log the payload for debugging eval run reporting
899+ agent_type = "coded" if is_coded else "low-code"
900+ logger .debug (
901+ f"Creating eval run (type={ agent_type } ): "
902+ f"evalSetRunId={ eval_set_run_id } , evalItemId={ eval_item .id } "
903+ )
904+ logger .debug (f"Full eval run payload: { json .dumps (payload , indent = 2 )} " )
905+
829906 return RequestSpec (
830907 method = "POST" ,
831908 endpoint = Endpoint (
@@ -872,6 +949,16 @@ def _create_eval_set_run_spec(
872949 # Both coded and legacy send payload directly at root level
873950 payload = inner_payload
874951
952+ # Log the payload for debugging eval set run reporting
953+ agent_type = "coded" if is_coded else "low-code"
954+ logger .info (
955+ f"Creating eval set run (type={ agent_type } ): "
956+ f"evalSetId={ eval_set_id } , "
957+ f"inputSchema={ json .dumps (payload .get ('agentSnapshot' , {}).get ('inputSchema' , {}))} , "
958+ f"outputSchema={ json .dumps (payload .get ('agentSnapshot' , {}).get ('outputSchema' , {}))} "
959+ )
960+ logger .debug (f"Full eval set run payload: { json .dumps (payload , indent = 2 )} " )
961+
875962 return RequestSpec (
876963 method = "POST" ,
877964 endpoint = Endpoint (
@@ -926,6 +1013,17 @@ def _update_eval_set_run_spec(
9261013 # Both coded and legacy send payload directly at root level
9271014 payload = inner_payload
9281015
1016+ # Log the payload for debugging eval set run updates
1017+ agent_type = "coded" if is_coded else "low-code"
1018+ logger .info (
1019+ f"Updating eval set run (type={ agent_type } ): "
1020+ f"evalSetRunId={ eval_set_run_id } , success={ success } , "
1021+ f"evaluatorScores={ json .dumps (payload .get ('evaluatorScores' , []))} "
1022+ )
1023+ logger .debug (
1024+ f"Full eval set run update payload: { json .dumps (payload , indent = 2 )} "
1025+ )
1026+
9291027 return RequestSpec (
9301028 method = "PUT" ,
9311029 endpoint = Endpoint (
0 commit comments