4141from pydantic import Field
4242from typing_extensions import override
4343
44- from .testing_utils import _split_name_and_run_id
4544from .testing_utils import END_OF_AGENT
4645from .testing_utils import simplify_content
4746
@@ -183,19 +182,6 @@ async def create_parent_invocation_context(
183182 )
184183
185184
186- def _build_node_name_map (events : list [Event ]) -> dict [str , str ]:
187- """Builds a map from node name to source node name from state updates."""
188- node_name_map = {}
189- for event in events :
190- if event .actions .agent_state :
191- nodes = event .actions .agent_state .get ('nodes' , {})
192- for node_name , node_state in nodes .items ():
193- source_name = node_state .get ('source_node_name' )
194- if source_name :
195- node_name_map [node_name ] = source_name
196- return node_name_map
197-
198-
199185def simplify_event_with_node (
200186 event : Event ,
201187 include_state_delta : bool = False ,
@@ -240,14 +226,9 @@ def simplify_events_with_node(
240226 events : list [Event ],
241227 * ,
242228 include_state_delta : bool = False ,
243- map_dynamic_node_to_the_source : bool = False ,
244229 include_workflow_output : bool = False ,
245230) -> list [tuple [str , Any ]]:
246231 results = []
247- node_name_map = {}
248-
249- if map_dynamic_node_to_the_source :
250- node_name_map = _build_node_name_map (events )
251232
252233 # Second pass: Simplify events
253234 for event in events :
@@ -268,11 +249,7 @@ def simplify_events_with_node(
268249 if hasattr (event , 'node_info' ) and event .node_info .path :
269250 author = event .node_info .path
270251 else :
271- author = node_name_map .get (event .author , event .author )
272- # Strip auto-generated dynamic execution run IDs or counter numeric indices
273- # from dynamic child/standalone parallel execution authors so assertions
274- # match base node definition names consistently.
275- author , _ = _split_name_and_run_id (author )
252+ author = event .author
276253 results .append ((author , simplified_event ))
277254 return results
278255
@@ -283,7 +260,6 @@ def simplify_events_with_node_and_agent_state(
283260 include_state_delta : bool = False ,
284261 include_inputs_and_triggers : bool = False ,
285262 include_resume_inputs : bool = False ,
286- map_dynamic_node_to_the_source : bool = False ,
287263 include_workflow_output : bool = False ,
288264):
289265 fields_to_exclude = {'run_id' }
@@ -293,10 +269,6 @@ def simplify_events_with_node_and_agent_state(
293269 fields_to_exclude .add ('resume_inputs' )
294270
295271 results = []
296- node_name_map = {}
297-
298- if map_dynamic_node_to_the_source :
299- node_name_map = _build_node_name_map (events )
300272
301273 for event in events :
302274 # Optionally skip top-level workflow output events.
@@ -313,7 +285,7 @@ def simplify_events_with_node_and_agent_state(
313285 if hasattr (event , 'node_info' ) and event .node_info .path :
314286 author = event .node_info .path
315287 else :
316- author = node_name_map . get ( event .author , event . author )
288+ author = event .author
317289
318290 if simplified_event :
319291 results .append ((author , simplified_event ))
0 commit comments