Repository navigation
fix(graph): resolve Literal collector items to the types of their values - #9895
Merged
lstein merged 4 commits intoOct 18, 2026
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
JPPhoto
self-requested a review
October 18, 2026 15:19
JPPhoto
approved these changes
Oct 18, 2026
lstein
enabled auto-merge (squash)
October 18, 2026 18:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A node output typed as a
Literal(e.g.max_seq_len: Literal[256, 512]on the FLUX / FLUX.2 model loaders) can't be fed into a Collect node. Collector validation treats the Literal's values as types and callsissubclass(256, ...), so validation crashes withTypeError: issubclass() arg 1 must be a classinstead of accepting or rejecting the edge. On the enqueue path this happens while theBatchbody is parsed, so the API returns a 500 rather than a 422 (the same failure mode discussed in #9858)._resolve_item_input_typesnow resolves aLiteral[...]item to the types of its values (Literal[256, 512]→int,Optional[Literal["a", "b"]]→str), so the existing subtype checks work as intended:literal.value → collect.item → integer_collection.collection→TypeError(500 on enqueue)InvalidEdgeError/ 422 "Collector outputs must connect to a collection input with a matching type"Related Issues / Discussions
issubclassin_validate_collector_output_typesforUnion[list[X], X]inputs. With that guard alone a Literal item would be rejected even for a matchingintcollection. This PR fixes the item side, and the two don't touch the same lines.QA Instructions
Added a small
test_literalinvocation totests/test_nodes.pyand four tests totests/test_node_graph.py:InvalidEdgeErrorOptional[Literal[...]]items into a string collection are acceptedBatchholding the mismatched graph raisesValidationError(notTypeError)All four fail on
mainwithTypeError: issubclass() arg 1 must be a classand pass with the fix.Review
No material findings. Only collector item-type resolution changes; non-Literal types resolve exactly as before.
Checklist
What's Newcopy (if doing a release after this PR) (n/a)AI-assisted: I used an AI assistant to help trace this and draft the change. I reviewed the code and tests and ran them locally.
Need help on this PR? Tag
@codesmith-botwith what you need.