fix: workflow incorrectly marked as completed while nodes are still executing#151
Conversation
Code Review by Qodo
1. print() in propagate_skip_from_edge
|
| # Start execution and enqueue node | ||
| print(f"Starting execution for node: {downstream_node_id}") | ||
| self._state_manager.start_execution(downstream_node_id) |
There was a problem hiding this comment.
1. print() in propagate_skip_from_edge 📘 Rule violation ✧ Quality
• The backend code introduces a print() statement to emit runtime execution information, instead of using a module-level logger. • This violates the requirement to use logging.getLogger(__name__) and logger calls for output, which is important for consistent observability and production log handling.
Agent prompt
## Issue description
Backend code uses `print()` for runtime output, which violates the requirement to use the logging module with a module-level logger.
## Issue Context
`skip_propagator.py` emits a message when starting execution for a node; this should be logged via `logger = logging.getLogger(__name__)` and a logger call rather than `print()`.
## Fix Focus Areas
- api/core/workflow/graph_engine/graph_traversal/skip_propagator.py[61-63]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| # Mark all outgoing edges as skipped and propagate | ||
| outgoing_edges = self._graph.get_outgoing_edges(node_id) | ||
| 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.
2. Skip propagation blocked 🐞 Bug ✓ Correctness
• Outgoing edges are now marked SKIPPED only after calling propagate_skip_from_edge, so the downstream node still observes that incoming edge as UNKNOWN. • propagate_skip_from_edge explicitly stops when any incoming edge is UNKNOWN, so skip state won’t propagate past one hop. • This can leave nodes/edges incorrectly UNKNOWN (instead of SKIPPED) and can prevent other nodes from becoming ready because UNKNOWN incoming edges make is_node_ready return False.
Agent prompt
### Issue description
`SkipPropagator._propagate_skip_to_node()` currently calls `propagate_skip_from_edge(edge.id)` before marking that `edge` as `SKIPPED`. Because `propagate_skip_from_edge()` stops when any incoming edge is `UNKNOWN`, downstream skip propagation will terminate early.
### Issue Context
Downstream nodes compute incoming edge states via `Graph.get_incoming_edges()` and `GraphStateManager.analyze_edge_states()`. The edge being propagated from must already be `SKIPPED` for the downstream node’s analysis to proceed.
### Fix Focus Areas
- api/core/workflow/graph_engine/graph_traversal/skip_propagator.py[81-87]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Benchmark PR from agentic-review-benchmarks#13