-
Notifications
You must be signed in to change notification settings - Fork 0
Code Review Bench PR #30251 - fix: workflow incorrectly marked as completed while nodes are still executing #13
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: base_pr_30251_20260125_2802
Are you sure you want to change the base?
Conversation
| for edge in outgoing_edges: | ||
| self._state_manager.mark_edge_skipped(edge.id) | ||
| # Recursively propagate skip | ||
| 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.
🚨 Bug: Edge marked as skipped AFTER propagation breaks recursion
The reordering of mark_edge_skipped() to occur AFTER propagate_skip_from_edge() breaks the recursive skip propagation entirely.
How it fails:
_propagate_skip_to_node("A")is called for a skipped node A- For each outgoing edge from A,
propagate_skip_from_edge(edge.id)is called BEFOREmark_edge_skipped(edge.id) - Inside
propagate_skip_from_edge, it callsanalyze_edge_states(incoming_edges)on the downstream node - Since the edge has NOT been marked as skipped yet (still UNKNOWN),
analyze_edge_statesreturnshas_unknown=True - The method returns immediately without propagating — the skip chain is broken
Evidence from the same file: The skip_branch_paths() method (line 95-97) correctly marks the edge as skipped BEFORE calling propagate_skip_from_edge(). The original order in _propagate_skip_to_node was also correct (mark first, then propagate).
Impact: Skip states will not propagate beyond the first level of outgoing edges. Downstream nodes that should be skipped will remain in UNKNOWN state, potentially causing the workflow to hang waiting for nodes that will never execute.
Was this helpful? React with 👍 / 👎
| for edge in outgoing_edges: | |
| self._state_manager.mark_edge_skipped(edge.id) | |
| # Recursively propagate skip | |
| self.propagate_skip_from_edge(edge.id) | |
| self._state_manager.mark_edge_skipped(edge.id) | |
| for edge in outgoing_edges: | |
| self._state_manager.mark_edge_skipped(edge.id) | |
| # Recursively propagate skip | |
| self.propagate_skip_from_edge(edge.id) |
- Apply suggested fix
| 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.
⚠️ Quality: Debug print() statement left in production code
A print(f"Starting execution for node: {downstream_node_id}") statement is left in production workflow execution code. This will write to stdout on every workflow node execution where skip propagation triggers the "has_taken" path.
Impact:
- Pollutes application logs/stdout in production
- In containerized/serverless environments, this adds noise to structured logging
- Performance overhead from string formatting on every invocation (minor but unnecessary)
This should either be removed or replaced with proper logging using the logging module at DEBUG level.
Was this helpful? React with 👍 / 👎
| print(f"Starting execution for node: {downstream_node_id}") | |
| # Start execution and enqueue node | |
| self._state_manager.start_execution(downstream_node_id) |
- Apply suggested fix
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.
Configure merge blocking · Maintainers can dismiss this review. Gitar never approves changes.
Code Review 🚫 Blocked 0 resolved / 3 findingsThe 🚨 Bug: Edge marked as skipped AFTER propagation breaks recursion📄 api/core/workflow/graph_engine/graph_traversal/skip_propagator.py:83-86 The reordering of How it fails:
Evidence from the same file: The Impact: Skip states will not propagate beyond the first level of outgoing edges. Downstream nodes that should be skipped will remain in UNKNOWN state, potentially causing the workflow to hang waiting for nodes that will never execute. Suggested fix
|
| Auto-apply | Compact |
|
|
Was this helpful? React with 👍 / 👎 | Gitar
Benchmark PR for Gitar evaluation
Original PR: agentic-review-benchmarks#13
fix: workflow incorrectly marked as completed while nodes are still executing