You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug]: If inside a For body cannot select root-frame branch values (hang on main, KeyError with #9789) #9818
Consider an If inside a For body whose condition is the loop item, with root-frame nodes (nodes with no loop input) on its branches. On main the session hangs right after for runs: next() returns None and is_complete() stays False. With #9789 it fails with KeyError: 'root_true' or KeyError: 'root_false' from create_for_body_iteration.
This happens for every condition sequence, including [False, False] and [True, True].
What you expected to happen
Each iteration should return the selected root value, for example ["false-root", "true-root"] for [False, True]. A root branch value should run once, and only if some iteration selects it.
Run it with the _run_graph helper from tests/app/services/shared/test_execution_engine_differential.py. The helpers come from tests/test_nodes.py.
Additional context
The For body planner creates each iteration without an admission check and expects every body input to be prepared already. A root-frame branch source is prepared only when some If execution selects it, and those executions appear one iteration at a time.
The same shape with an Iterate instead of a For works with #9789. Any fix also needs to make sure that once every iteration has resolved, an unselected root source is rejected rather than run.
Resolved in PR #9843. The selected If branch now resolves root-frame inputs against its activation frame, including inside For bodies. Regression coverage checks mixed, all-true, and all-false conditions and confirms unselected root sources do not run.
Activity
JPPhoto commentedon Oct 18, 2026
Resolved in PR #9843. The selected If branch now resolves root-frame inputs against its activation frame, including inside For bodies. Regression coverage checks mixed, all-true, and all-false conditions and confirms unselected root sources do not run.