fix(api): defer streaming response until referenced variables are updated - #27
Open
tomerqodo wants to merge 3 commits into
Open
fix(api): defer streaming response until referenced variables are updated#27tomerqodo wants to merge 3 commits into
tomerqodo wants to merge 3 commits into
Conversation
| Returns True if this node updates any of the requested conversation variables. | ||
| """ | ||
| assigned_selector = self.node_data.assigned_variable_selector | ||
| return assigned_selector in variable_selectors |
There was a problem hiding this comment.
Bug: The blocks_variable_output method in the v1 Variable Assigner will raise a TypeError because it attempts to check for a list within a set of tuples.
Severity: HIGH
Suggested Fix
Convert the assigned_selector list to a tuple before checking for its membership in the variable_selectors set. The line should be changed to return tuple(assigned_selector) in variable_selectors.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: api/core/workflow/nodes/variable_assigner/v1/node.py#L43
Potential issue: In the `blocks_variable_output` method of the v1 Variable Assigner
node, a `TypeError` will occur. The method attempts to check if `assigned_selector`,
which is a list, is a member of `variable_selectors`, which is a set of tuples. Because
lists are mutable and therefore unhashable, Python cannot perform the set membership
test and will raise a `TypeError: unhashable type: 'list'`. This will cause any workflow
to crash if it uses a v1 Variable Assigner to update a conversation variable that is
also referenced in the final answer node, breaking the feature that defers the response
until variables are updated.
Did we get this right? 👍 / 👎 to inform future reviews.
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.
Benchmark PR from qodo-benchmark#423