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
Flattened Iteration output breaks List Operator when one round returns an empty array #459
With output flattening enabled, an Iteration that returns [] in one round and ["ok"] in another produces the right value with the wrong type.
The downstream List Operator rejects the nonempty array[any] and the workflow fails.
Reproduction
Set the Iteration input to [[], ["ok"]], use its current item as the output, and enable flattening.
Connect the Iteration output to a List Operator with its default settings.
Run the workflow. The List Operator reports that it received an ArrayAnyVariable.
The same failure occurs with the empty round last and with numeric input such as [[2, 1], []].
Reproduced on Graphon main at 5d00f29.
Expected behavior
The List Operator should receive ["ok"] as array[string] or [2, 1] as array[number].
An empty array[any] supplies no element type. Other arrays can still supply one, including explicitly typed empty arrays.
If every round returns an untyped empty array, the result should remain an empty array[any].
The fix belongs in Iteration’s _collect_iteration_outputs. It flattens the values correctly, but counts every array’s type tag when deciding which type to keep. I’d skip only empty ArrayAnySegment instances in that vote and copy the type from the first remaining array if the remaining tags agree. Keep the ArrayAnySegment fallback when no arrays vote or the tags disagree. Don’t re-infer from the flattened values: the existing declared-any and mixed-types tests protect nonempty array[any] and conflicting typed empties, respectively. [1][2]
test_iteration_preserves_array_output_types already asserts both the runtime type and the final value, so it’s a good place for the new cases. In a downstream List Operator regression, include a nonempty result: the operator returns success for empty input before checking the type, so an all-empty case alone won’t catch this bug. [3][4][5]
Activity
dosubot commentedon Dec 4, 2026
The fix belongs in Iteration’s
_collect_iteration_outputs. It flattens the values correctly, but counts every array’s type tag when deciding which type to keep. I’d skip only emptyArrayAnySegmentinstances in that vote and copy the type from the first remaining array if the remaining tags agree. Keep theArrayAnySegmentfallback when no arrays vote or the tags disagree. Don’t re-infer from the flattened values: the existingdeclared-anyandmixed-typestests protect nonemptyarray[any]and conflicting typed empties, respectively. [1] [2]test_iteration_preserves_array_output_typesalready asserts both the runtime type and the final value, so it’s a good place for the new cases. In a downstream List Operator regression, include a nonempty result: the operator returns success for empty input before checking the type, so an all-empty case alone won’t catch this bug. [3] [4] [5]To reply, just mention @dosu.
Share context across your team and agents. Try Dosu.