Skip to content

fix(iteration): preserve flattened array types across empty rounds - #460

Open
WH-2099 wants to merge 2 commits into
mainfrom
fix/iteration-flatten-empty-arrays
Open

WH-2099 wants to merge 2 commits into
mainfrom
fix/iteration-flatten-empty-arrays

Conversation

@WH-2099

@WH-2099 WH-2099 commented Dec 4, 2026

Copy link
Copy Markdown
Member

Important

  1. Make sure you have read our contribution guidelines
  2. Search existing issues and pull requests to confirm this change is not a duplicate
  3. Open or identify the issue this pull request resolves or advances
  4. Use a Conventional Commits title for this pull request, and mark breaking changes with !
  5. Remember that the pull request title will become the squash merge commit message
  6. If CLA Assistant prompts you, sign CLA.md in the pull request conversation

Related Issue

Closes #459
Refs langgenius/dify#47571 (item 12).

Summary

A Code node can return [] in one round and ["ok"] in another.
Iteration flattened the values to ["ok"] but gave the result type array[any], which made the downstream List Operator fail.

Ignore empty array[any] rounds when selecting the flattened output type.
Typed empty arrays and populated array[any] rounds still participate, and an all-empty untyped result remains array[any].

The workflow regression tests cover strings and numbers in both orders, all-empty input, and mixed array types.
I also ran the four failing cases through Dify's node factory with a Code node and a stubbed code sandbox.
They failed on Dify's pinned Graphon revision and passed against this branch.

just check passed.
The full Graphon test suite had 1,470 passes and one failure in the seven-day documentation review check.
That check also fails on the unchanged base commit 5d00f29 and is tracked in #456.

Checklist

  • This pull request links the issue it resolves or advances
  • This pull request title follows Conventional Commits, and any breaking change is marked with !
  • If CLA Assistant prompted me, I signed CLA.md in the pull request conversation

Copilot AI balanced review requested due to automatic review settings December 4, 2026 20:52
@WH-2099 WH-2099 self-assigned this Dec 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flattened Iteration output breaks List Operator when one round returns an empty array

2 participants