Skip to content

fix(api): defer streaming response until referenced variables are updated - #27

Open
tomerqodo wants to merge 3 commits into
sentry_combined_20260121_augment_sentry_coderabbit_1_base_fixapi_defer_streaming_response_until_referenced_variables_are_updated_pr423from
sentry_combined_20260121_augment_sentry_coderabbit_1_head_fixapi_defer_streaming_response_until_referenced_variables_are_updated_pr423
Open

fix(api): defer streaming response until referenced variables are updated#27
tomerqodo wants to merge 3 commits into
sentry_combined_20260121_augment_sentry_coderabbit_1_base_fixapi_defer_streaming_response_until_referenced_variables_are_updated_pr423from
sentry_combined_20260121_augment_sentry_coderabbit_1_head_fixapi_defer_streaming_response_until_referenced_variables_are_updated_pr423

Conversation

@tomerqodo

Copy link
Copy Markdown

Benchmark PR from qodo-benchmark#423

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

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.

2 participants