diff --git a/features/steps/actor_subgraph_cycle_detection_steps.py b/features/steps/actor_subgraph_cycle_detection_steps.py index eaa55185f..5222858a1 100644 --- a/features/steps/actor_subgraph_cycle_detection_steps.py +++ b/features/steps/actor_subgraph_cycle_detection_steps.py @@ -199,3 +199,22 @@ def step_actor_subgraph_refs_map(context: Context, node: str, ref: str) -> None: assert refs.get(node) == ref, ( f"Expected subgraph_refs[{node!r}] == {ref!r}, got {refs}" ) + + +@then('the compiled node "{node_id}" should have subgraph set to "{expected_ref}"') +def step_compiled_node_has_subgraph( + context: Context, node_id: str, expected_ref: str +) -> None: + """Assert that the compiled node config has the correct subgraph value.""" + assert context.compiled is not None + node = context.compiled.nodes.get(node_id) + assert node is not None, ( + f"Compiled node {node_id!r} not found. Available nodes: " + f"{list(context.compiled.nodes.keys())}" + ) + actual_subgraph = getattr(node, "subgraph", None) + assert actual_subgraph == expected_ref, ( + f"Expected NodeConfig.subgraph[{node_id!r}] == {expected_ref!r}, " + f"got {actual_subgraph!r}. This indicates the compiler reads actor_ref " + f"from config.get() instead of node.actor_ref (issue #1429)." + )