-
Notifications
You must be signed in to change notification settings - Fork 0
fix(api): defer streaming response until referenced variables are updated #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: greptile_combined_20260121_qodo_grep_cursor_copilot_1_base_fixapi_defer_streaming_response_until_referenced_variables_are_updated_pr423
Are you sure you want to change the base?
fix(api): defer streaming response until referenced variables are updated #86
Conversation
Greptile SummaryThis PR fixes a streaming bug where conversation variables were output before being updated by the Variable Assigner node. The fix adds a
Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant WorkflowEngine
participant ResponseCoordinator
participant VariableAssignerNode
participant VariablePool
participant AnswerNode
User->>WorkflowEngine: Start workflow with query
WorkflowEngine->>ResponseCoordinator: Initialize with conversation variables
ResponseCoordinator->>ResponseCoordinator: Build paths to response nodes
ResponseCoordinator->>VariableAssignerNode: Check blocks_variable_output(conv_var)
VariableAssignerNode-->>ResponseCoordinator: Returns True (blocks streaming)
WorkflowEngine->>VariableAssignerNode: Execute node
VariableAssignerNode->>VariablePool: Get original conversation variable
VariableAssignerNode->>VariablePool: Get input value (sys.query)
VariableAssignerNode->>VariableAssignerNode: Create updated variable
VariableAssignerNode->>VariablePool: Update conversation variable
VariableAssignerNode->>WorkflowEngine: Emit NodeRunStreamChunkEvent
VariableAssignerNode-->>WorkflowEngine: Return NodeRunResult
WorkflowEngine->>ResponseCoordinator: Node completed
ResponseCoordinator->>ResponseCoordinator: Remove blocking edge
ResponseCoordinator->>AnswerNode: Start streaming with updated conv_var
AnswerNode->>VariablePool: Reference updated conv_var
AnswerNode->>User: Stream response with correct value
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 1 comment
| @@ -1,5 +1,5 @@ | |||
| from collections.abc import Mapping, Sequence | |||
| from typing import TYPE_CHECKING, Any | |||
| from typing import TYPE_CHECKING, Any, Set, Tuple | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: uses legacy typing imports Set and Tuple instead of modern Python 3.12+ syntax
| from typing import TYPE_CHECKING, Any, Set, Tuple | |
| from typing import TYPE_CHECKING, Any |
Then update line 36 to use set[tuple[str, ...]] instead of Set[Tuple[str, ...]]
Context Used: Context from dashboard - CLAUDE.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Prompt To Fix With AI
This is a comment left during a code review.
Path: api/core/workflow/nodes/variable_assigner/v1/node.py
Line: 2:2
Comment:
**style:** uses legacy typing imports `Set` and `Tuple` instead of modern Python 3.12+ syntax
```suggestion
from typing import TYPE_CHECKING, Any
```
Then update line 36 to use `set[tuple[str, ...]]` instead of `Set[Tuple[str, ...]]`
**Context Used:** Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=a5f96311-5bd1-49f2-9828-2ee0c089c012))
<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>
How can I resolve this? If you propose a fix, please make it concise.
Benchmark PR from qodo-benchmark#423