@@ -46,8 +46,7 @@ async def execute(
4646
4747 tracer = trace .get_tracer ("uipath.dev.mock-runtime" )
4848
49- execution_id = getattr (self .context , "job_id" , None ) or "mock-execution"
50- entrypoint = getattr (self .context , "entrypoint" , None ) or "mock-entrypoint"
49+ entrypoint = "mock-entrypoint"
5150 message = str (payload .get ("message" , "" ))
5251 message_length = len (message )
5352
@@ -56,7 +55,6 @@ async def execute(
5655 attributes = {
5756 "uipath.runtime.name" : "MockRuntime" ,
5857 "uipath.runtime.type" : "agent" ,
59- "uipath.execution.id" : execution_id ,
6058 "uipath.runtime.entrypoint" : entrypoint ,
6159 "uipath.input.message.length" : message_length ,
6260 "uipath.input.has_message" : "message" in payload ,
@@ -65,19 +63,17 @@ async def execute(
6563 logger .info (
6664 "MockRuntime: starting execution" ,
6765 extra = {
68- "uipath.execution.id" : execution_id ,
6966 "uipath.runtime.entrypoint" : entrypoint ,
7067 },
7168 )
72- print (f"[MockRuntime] Starting execution (execution_id= { execution_id } ) " )
69+ print (f"[MockRuntime] Starting execution with payload= { payload !r } " )
7370
7471 # Stage 1: Initialization
7572 with tracer .start_as_current_span (
7673 "initialize.environment" ,
7774 attributes = {
7875 "uipath.step.name" : "initialize-environment" ,
7976 "uipath.step.kind" : "init" ,
80- "uipath.execution.id" : execution_id ,
8177 },
8278 ):
8379 logger .info ("MockRuntime: initializing environment" )
@@ -90,7 +86,6 @@ async def execute(
9086 attributes = {
9187 "uipath.step.name" : "validate-input" ,
9288 "uipath.step.kind" : "validation" ,
93- "uipath.execution.id" : execution_id ,
9489 "uipath.input.has_message" : "message" in payload ,
9590 },
9691 ) as validate_span :
@@ -110,7 +105,6 @@ async def execute(
110105 attributes = {
111106 "uipath.step.name" : "preprocess-data" ,
112107 "uipath.step.kind" : "preprocess" ,
113- "uipath.execution.id" : execution_id ,
114108 "uipath.input.size.bytes" : len (str (payload ).encode ("utf-8" )),
115109 },
116110 ):
@@ -124,7 +118,6 @@ async def execute(
124118 attributes = {
125119 "uipath.step.name" : "compute-result" ,
126120 "uipath.step.kind" : "compute" ,
127- "uipath.execution.id" : execution_id ,
128121 },
129122 ):
130123 logger .info ("MockRuntime: compute phase started" )
@@ -136,7 +129,6 @@ async def execute(
136129 attributes = {
137130 "uipath.step.name" : "compute-embeddings" ,
138131 "uipath.step.kind" : "compute-subtask" ,
139- "uipath.execution.id" : execution_id ,
140132 },
141133 ):
142134 logger .info ("MockRuntime: computing embeddings" )
@@ -149,7 +141,6 @@ async def execute(
149141 attributes = {
150142 "uipath.step.name" : "query-knowledgebase" ,
151143 "uipath.step.kind" : "io" ,
152- "uipath.execution.id" : execution_id ,
153144 "uipath.kb.query.length" : message_length ,
154145 },
155146 ):
@@ -163,7 +154,6 @@ async def execute(
163154 attributes = {
164155 "uipath.step.name" : "postprocess-results" ,
165156 "uipath.step.kind" : "postprocess" ,
166- "uipath.execution.id" : execution_id ,
167157 },
168158 ):
169159 logger .info ("MockRuntime: post-processing results" )
@@ -175,7 +165,6 @@ async def execute(
175165 attributes = {
176166 "uipath.step.name" : "generate-output" ,
177167 "uipath.step.kind" : "postprocess-subtask" ,
178- "uipath.execution.id" : execution_id ,
179168 },
180169 ):
181170 logger .info ("MockRuntime: generating structured output" )
@@ -188,7 +177,6 @@ async def execute(
188177 attributes = {
189178 "uipath.step.name" : "persist-artifacts" ,
190179 "uipath.step.kind" : "io" ,
191- "uipath.execution.id" : execution_id ,
192180 "uipath.persistence.enabled" : False ,
193181 },
194182 ):
@@ -202,7 +190,6 @@ async def execute(
202190 attributes = {
203191 "uipath.step.name" : "cleanup-resources" ,
204192 "uipath.step.kind" : "cleanup" ,
205- "uipath.execution.id" : execution_id ,
206193 },
207194 ):
208195 logger .info ("MockRuntime: cleaning up resources" )
@@ -212,7 +199,6 @@ async def execute(
212199 result_payload = {
213200 "result" : f"Mock runtime processed: { payload .get ('message' , '<no message>' )} " ,
214201 "metadata" : {
215- "execution_id" : execution_id ,
216202 "entrypoint" : entrypoint ,
217203 "message_length" : message_length ,
218204 },
@@ -228,7 +214,6 @@ async def execute(
228214 logger .info (
229215 "MockRuntime: execution completed successfully" ,
230216 extra = {
231- "uipath.execution.id" : execution_id ,
232217 "uipath.runtime.status" : "success" ,
233218 },
234219 )
0 commit comments