@@ -206,10 +206,10 @@ def act( # noqa: C901
206206 )
207207
208208 # Track data collected during step execution for step_end emission on failure
209- _step_snap_with_diff : Optional [ Snapshot ] = None
210- _step_pre_url : Optional [ str ] = None
211- _step_llm_response : Optional [ LLMResponse ] = None
212- _step_result : Optional [ AgentActionResult ] = None
209+ _step_snap_with_diff : Snapshot | None = None
210+ _step_pre_url : str | None = None
211+ _step_llm_response : LLMResponse | None = None
212+ _step_result : AgentActionResult | None = None
213213 _step_duration_ms : int = 0
214214
215215 for attempt in range (max_retries + 1 ):
@@ -564,7 +564,9 @@ def act( # noqa: C901
564564 snapshot_digest = f"sha256:{ self ._compute_hash (f'{ _step_pre_url } { _step_snap_with_diff .timestamp } ' )} "
565565
566566 # Build pre_elements from snap_with_diff (includes diff_status)
567- snapshot_event_data = TraceEventBuilder .build_snapshot_event (_step_snap_with_diff )
567+ snapshot_event_data = TraceEventBuilder .build_snapshot_event (
568+ _step_snap_with_diff
569+ )
568570 pre_elements = snapshot_event_data .get ("elements" , [])
569571
570572 # Build LLM data if available
@@ -847,10 +849,10 @@ async def act( # noqa: C901
847849 )
848850
849851 # Track data collected during step execution for step_end emission on failure
850- _step_snap_with_diff : Optional [ Snapshot ] = None
851- _step_pre_url : Optional [ str ] = None
852- _step_llm_response : Optional [ LLMResponse ] = None
853- _step_result : Optional [ AgentActionResult ] = None
852+ _step_snap_with_diff : Snapshot | None = None
853+ _step_pre_url : str | None = None
854+ _step_llm_response : LLMResponse | None = None
855+ _step_result : AgentActionResult | None = None
854856 _step_duration_ms : int = 0
855857
856858 for attempt in range (max_retries + 1 ):
@@ -1204,7 +1206,9 @@ async def act( # noqa: C901
12041206 snapshot_digest = f"sha256:{ self ._compute_hash (f'{ _step_pre_url } { _step_snap_with_diff .timestamp } ' )} "
12051207
12061208 # Build pre_elements from snap_with_diff (includes diff_status)
1207- snapshot_event_data = TraceEventBuilder .build_snapshot_event (_step_snap_with_diff )
1209+ snapshot_event_data = TraceEventBuilder .build_snapshot_event (
1210+ _step_snap_with_diff
1211+ )
12081212 pre_elements = snapshot_event_data .get ("elements" , [])
12091213
12101214 # Build LLM data if available
0 commit comments