Skip to content

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

Open
tomerqodo wants to merge 3 commits into
augment_full_base_fixapi_defer_streaming_response_until_referenced_variables_are_updated_pr1from
augment_full_head_fixapi_defer_streaming_response_until_referenced_variables_are_updated_pr1
Open

fix(api): defer streaming response until referenced variables are updated#1
tomerqodo wants to merge 3 commits into
augment_full_base_fixapi_defer_streaming_response_until_referenced_variables_are_updated_pr1from
augment_full_head_fixapi_defer_streaming_response_until_referenced_variables_are_updated_pr1

Conversation

@tomerqodo

Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#1

@augmentcode

augmentcode Bot commented Jan 26, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR fixes streaming responses that reference conversation variables by ensuring output streaming is deferred until the relevant variable assignment has completed.

Changes:

  • Added blocks_variable_output() to the v1 Variable Assigner node so the streaming coordinator can treat it as a blocking node for specific variable selectors.
  • Adjusted v1 Variable Assigner NodeRunResult.inputs["value"] handling to return a value appropriate to the write mode (notably for clear).
  • Added a new workflow fixture (test_streaming_conversation_variables_v1_overwrite.yml) that assigns sys.query into a conversation variable and then renders it in an Answer node.
  • Added a unit test validating that streamed conversation-variable chunks reflect the updated value (and not the default) when using v1 overwrite assignment.

Technical Notes: The response coordinator builds a set[tuple[str, ...]] of referenced variable selectors from response templates, and uses blocks_variable_output() to decide which upstream nodes must finish before flushing streaming output.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot 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.

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

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.

variable_selectors is built as a set[tuple[str, ...]] (see response coordinator), but assigned_variable_selector is a Sequence[str] (likely a list), so assigned_selector in variable_selectors will never match and this node won’t actually block streaming. Consider normalizing to a tuple (similar to v2.VariableAssignerNode.blocks_variable_output) before the membership check.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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