-
Notifications
You must be signed in to change notification settings - Fork 0
fix: workflow incorrectly marked as completed while nodes are still executing #98
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_fix_workflow_incorrectly_marked_as_completed_while_nodes_are_still_executing_pr441
Are you sure you want to change the base?
fix: workflow incorrectly marked as completed while nodes are still executing #98
Conversation
Greptile SummaryFixed critical bug where workflows were incorrectly marked as completed while nodes were still executing, and added comprehensive unit tests. Key Changes:
Confidence Score: 3/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant SP as SkipPropagator
participant SM as GraphStateManager
participant G as Graph
participant RQ as ReadyQueue
Note over SP: propagate_skip_from_edge(edge_id)
SP->>G: edges[edge_id].head
G-->>SP: downstream_node_id
SP->>G: get_incoming_edges(downstream_node_id)
G-->>SP: incoming_edges[]
SP->>SM: analyze_edge_states(incoming_edges)
SM-->>SP: {has_unknown, has_taken, all_skipped}
alt has_unknown == true
Note over SP: Stop processing (node not ready)
else has_taken == true
Note over SP: Fix: Added start_execution before enqueue
SP->>SM: start_execution(downstream_node_id)
Note over SM: _executing_nodes.add(node_id)
SP->>SM: enqueue_node(downstream_node_id)
SM->>G: nodes[node_id].state = TAKEN
SM->>RQ: put(node_id)
else all_skipped == true
SP->>SP: _propagate_skip_to_node(downstream_node_id)
SP->>SM: mark_node_skipped(downstream_node_id)
SM->>G: nodes[node_id].state = SKIPPED
SP->>G: get_outgoing_edges(node_id)
G-->>SP: outgoing_edges[]
loop for each edge in outgoing_edges
Note over SP: Order changed: propagate before marking
SP->>SP: propagate_skip_from_edge(edge.id)
SP->>SM: mark_edge_skipped(edge.id)
SM->>G: edges[edge_id].state = SKIPPED
end
end
|
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, 2 comments
| if edge_states["has_taken"]: | ||
| # Enqueue node | ||
| # Start execution and enqueue node | ||
| print(f"Starting execution for node: {downstream_node_id}") |
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.
syntax: print() statement violates compliance rules - backend code must use logging instead of print statements.
| print(f"Starting execution for node: {downstream_node_id}") | |
| logger.debug("Starting execution for node: %s", downstream_node_id) |
Context Used: Context from dashboard - AGENTS.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: api/core/workflow/graph_engine/graph_traversal/skip_propagator.py
Line: 62:62
Comment:
**syntax:** `print()` statement violates compliance rules - backend code must use logging instead of print statements.
```suggestion
logger.debug("Starting execution for node: %s", downstream_node_id)
```
**Context Used:** Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=1028e8c2-7220-42d3-94ac-c7ba65fc7240))
How can I resolve this? If you propose a fix, please make it concise.| self.propagate_skip_from_edge(edge.id) | ||
| self._state_manager.mark_edge_skipped(edge.id) |
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.
logic: Swapping the order may cause issues - propagate_skip_from_edge checks edge states of the downstream node, but the edge hasn't been marked as skipped yet. This means the edge will still be in UNKNOWN state when analyze_edge_states is called in the recursive call, potentially causing incorrect skip propagation logic. Was this order change intentional and tested with scenarios where downstream nodes check the state of this edge?
Prompt To Fix With AI
This is a comment left during a code review.
Path: api/core/workflow/graph_engine/graph_traversal/skip_propagator.py
Line: 85:86
Comment:
**logic:** Swapping the order may cause issues - `propagate_skip_from_edge` checks edge states of the downstream node, but the edge hasn't been marked as skipped yet. This means the edge will still be in UNKNOWN state when `analyze_edge_states` is called in the recursive call, potentially causing incorrect skip propagation logic. Was this order change intentional and tested with scenarios where downstream nodes check the state of this edge?
How can I resolve this? If you propose a fix, please make it concise.
Benchmark PR from qodo-benchmark#441