@@ -94,14 +94,14 @@ async def _node(
9494 "GuardrailName" : guardrail .name ,
9595 "GuardrailDescription" : guardrail .description ,
9696 "Component" : _build_component_name (scope , guarded_component_name ),
97+ "TenantName" : UiPathConfig .tenant_name ,
9798 "ExecutionStage" : _execution_stage_to_string (execution_stage ),
9899 "GuardrailResult" : state .inner_state .guardrail_validation_details ,
99100 }
100101
101102 # Add tenant and trace URL if base_url is configured
102103 cloud_base_url = UiPathConfig .base_url
103104 if cloud_base_url is not None :
104- data ["TenantName" ] = _get_tenant_name (cloud_base_url )
105105 data ["AgentTrace" ] = _get_agent_execution_viewer_url (cloud_base_url )
106106
107107 # Add stage-specific fields
@@ -689,19 +689,6 @@ def _execution_stage_to_string(
689689 return "PostExecution"
690690
691691
692- def _get_tenant_name (cloud_base_url : str ) -> str :
693- """Extract the tenant name from the UiPath base URL.
694-
695- Args:
696- cloud_base_url: The UiPath cloud base URL to extract tenant name from.
697-
698- Returns:
699- str: The tenant name extracted from the base URL.
700- """
701- uiPath_Url = UiPathUrl (cloud_base_url )
702- return uiPath_Url .tenant_name
703-
704-
705692def _get_agent_execution_viewer_url (cloud_base_url : str ) -> str :
706693 """Generate the agent execution viewer URL based on execution context.
707694
@@ -717,15 +704,17 @@ def _get_agent_execution_viewer_url(cloud_base_url: str) -> str:
717704 """
718705 uiPath_Url = UiPathUrl (cloud_base_url )
719706 organization_id = UiPathConfig .organization_id
720- agent_id = UiPathConfig .project_id
707+ project_id = UiPathConfig .project_id
721708
722709 # Route to appropriate URL based on source
723710 if UiPathConfig .is_studio_project :
724- return f"{ uiPath_Url .base_url } /{ organization_id } /studio_/designer/{ agent_id } "
711+ solutionId = UiPathConfig .studio_solution_id
712+ return f"{ uiPath_Url .base_url } /{ organization_id } /studio_/designer/{ project_id } ?solutionId={ solutionId } "
725713 else :
726714 execution_folder_id = UiPathConfig .folder_key
727715 process_uuid = UiPathConfig .process_uuid
728716 trace_id = UiPathConfig .trace_id
729717 package_version = UiPathConfig .process_version
718+ project_key = UiPathConfig .project_key
730719
731- return f"{ uiPath_Url .base_url } /{ organization_id } /agents_/deployed/{ execution_folder_id } /{ process_uuid } /{ agent_id } /{ package_version } /traces/{ trace_id } "
720+ return f"{ uiPath_Url .base_url } /{ organization_id } /agents_/deployed/{ execution_folder_id } /{ process_uuid } /{ project_key } /{ package_version } /traces/{ trace_id } "
0 commit comments