@@ -82,14 +82,14 @@ async def _node(
8282 "GuardrailName" : guardrail .name ,
8383 "GuardrailDescription" : guardrail .description ,
8484 "Component" : scope .name .lower (),
85+ "TenantName" : UiPathConfig .tenant_name ,
8586 "ExecutionStage" : _execution_stage_to_string (execution_stage ),
8687 "GuardrailResult" : state .guardrail_validation_result ,
8788 }
8889
8990 # Add tenant and trace URL if base_url is configured
9091 cloud_base_url = UiPathConfig .base_url
9192 if cloud_base_url is not None :
92- data ["TenantName" ] = _get_tenant_name (cloud_base_url )
9393 data ["AgentTrace" ] = _get_agent_execution_viewer_url (cloud_base_url )
9494
9595 # Add stage-specific fields
@@ -633,19 +633,6 @@ def _execution_stage_to_string(
633633 return "PostExecution"
634634
635635
636- def _get_tenant_name (cloud_base_url : str ) -> str :
637- """Extract the tenant name from the UiPath base URL.
638-
639- Args:
640- cloud_base_url: The UiPath cloud base URL to extract tenant name from.
641-
642- Returns:
643- str: The tenant name extracted from the base URL.
644- """
645- uiPath_Url = UiPathUrl (cloud_base_url )
646- return uiPath_Url .tenant_name
647-
648-
649636def _get_agent_execution_viewer_url (cloud_base_url : str ) -> str :
650637 """Generate the agent execution viewer URL based on execution context.
651638
@@ -661,15 +648,17 @@ def _get_agent_execution_viewer_url(cloud_base_url: str) -> str:
661648 """
662649 uiPath_Url = UiPathUrl (cloud_base_url )
663650 organization_id = UiPathConfig .organization_id
664- agent_id = UiPathConfig .project_id
651+ project_id = UiPathConfig .project_id
665652
666653 # Route to appropriate URL based on source
667654 if UiPathConfig .is_studio_project :
668- return f"{ uiPath_Url .base_url } /{ organization_id } /studio_/designer/{ agent_id } "
655+ solutionId = UiPathConfig .studio_solution_id
656+ return f"{ uiPath_Url .base_url } /{ organization_id } /studio_/designer/{ project_id } ?solutionId={ solutionId } "
669657 else :
670658 execution_folder_id = UiPathConfig .folder_key
671659 process_uuid = UiPathConfig .process_uuid
672660 trace_id = UiPathConfig .trace_id
673661 package_version = UiPathConfig .process_version
662+ agent_id = UiPathConfig .agent_id
674663
675664 return f"{ uiPath_Url .base_url } /{ organization_id } /agents_/deployed/{ execution_folder_id } /{ process_uuid } /{ agent_id } /{ package_version } /traces/{ trace_id } "
0 commit comments