Skip to content

Conversation

@hila-f-qodo
Copy link

@hila-f-qodo hila-f-qodo commented Jan 26, 2026

Benchmark PR from qodo-benchmark#441


Open with Devin

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View issues and 3 additional flags in Devin Review.

Open in Devin Review

Comment on lines 84 to +86
# Recursively propagate skip
self.propagate_skip_from_edge(edge.id)
self._state_manager.mark_edge_skipped(edge.id)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Skip propagation fails due to incorrect order of operations - edge marked as skipped AFTER propagation

The _propagate_skip_to_node method calls propagate_skip_from_edge(edge.id) before mark_edge_skipped(edge.id), which breaks skip propagation.

Click to expand

Root Cause

In the changed code at lines 84-86, the order of operations was swapped:

for edge in outgoing_edges:
    # Recursively propagate skip
    self.propagate_skip_from_edge(edge.id)  # Called first
    self._state_manager.mark_edge_skipped(edge.id)  # Called second

However, propagate_skip_from_edge at line 53 calls analyze_edge_states(incoming_edges) which checks the state of each incoming edge. Since edges default to NodeState.UNKNOWN (see api/core/workflow/graph/edge.py:15), the edge being processed is still UNKNOWN when propagate_skip_from_edge is called.

Actual vs Expected Behavior

  • Actual: analyze_edge_states returns has_unknown=True because the edge hasn't been marked as SKIPPED yet, causing propagate_skip_from_edge to return early at line 56-57 without propagating the skip.
  • Expected: The edge should be marked as SKIPPED first, so analyze_edge_states correctly identifies all edges as skipped and propagation continues.

Impact

Skip propagation will fail to propagate through the graph correctly. Downstream nodes that should be skipped will not be marked as skipped, potentially causing:

  1. Nodes executing when they shouldn't
  2. Workflow completing incorrectly
  3. The very issue this PR claims to fix (workflow marked as completed while nodes are still executing) may actually be made worse

Recommendation: Restore the original order - call mark_edge_skipped(edge.id) before propagate_skip_from_edge(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)
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

if edge_states["has_taken"]:
# Enqueue node
# Start execution and enqueue node
print(f"Starting execution for node: {downstream_node_id}")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Debug print statement left in production code

A debug print() statement was left in the production code, which violates the project's coding standards.

Click to expand

Issue

Line 62 contains:

print(f"Starting execution for node: {downstream_node_id}")

According to AGENTS.md rule #3 ("Backend Code Must Use Logging Instead of Print Statements"), all output should use the logging module rather than print statements.

Impact

  • Debug output will appear in production logs/stdout
  • Inconsistent with the rest of the codebase which uses proper logging
  • May cause issues in production environments where stdout is not expected

Recommendation: Either remove the debug statement entirely, or replace it with proper logging:

import logging
logger = logging.getLogger(__name__)
# ...
logger.debug(f"Starting execution for node: {downstream_node_id}")
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

3 participants