Skip to content

fix: workflow incorrectly marked as completed while nodes are still executing#13

Open
tomerqodo wants to merge 4 commits into
augment_full_base_fix_workflow_incorrectly_marked_as_completed_while_nodes_are_still_executing_pr13from
augment_full_head_fix_workflow_incorrectly_marked_as_completed_while_nodes_are_still_executing_pr13
Open

fix: workflow incorrectly marked as completed while nodes are still executing#13
tomerqodo wants to merge 4 commits into
augment_full_base_fix_workflow_incorrectly_marked_as_completed_while_nodes_are_still_executing_pr13from
augment_full_head_fix_workflow_incorrectly_marked_as_completed_while_nodes_are_still_executing_pr13

Conversation

@tomerqodo

Copy link
Copy Markdown

Benchmark PR from agentic-review-benchmarks#13

@augmentcode

augmentcode Bot commented Jan 26, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Fixes a race where a workflow run could be marked completed while downstream nodes are still pending execution.

Changes:

  • Update SkipPropagator.propagate_skip_from_edge to explicitly mark a downstream node as “executing” before enqueueing when any incoming edge is TAKEN.
  • Adjust skip propagation logic in _propagate_skip_to_node for outgoing edges while recursively walking the graph.
  • Add a new unit-test package for graph traversal components.
  • Add a comprehensive SkipPropagator unit test suite covering UNKNOWN / TAKEN / all-SKIPPED edge-state combinations and basic recursion scenarios.

Technical Notes: Execution completion is determined by the ready-queue being empty and the executing-node set being empty; this change aims to ensure nodes made runnable during skip-propagation are reflected in that executing-node tracking.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

print(...) in the graph engine path will write to stdout during normal runs and tests; this is likely unintended and can create noisy/slow execution for large graphs. Consider using the project logger (or removing the output) so workflow runs don’t emit debug lines by default.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

propagate_skip_from_edge() assumes it’s being called “from a skipped edge”, but here the outgoing edge isn’t marked SKIPPED until after the recursive call. This can cause downstream nodes to see that incoming edge as UNKNOWN and stop propagation early, leaving nodes/edges unskipped.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

mock_graph.get_outgoing_edges.return_value = [edge1, edge2]

# Setup get_incoming_edges to return empty list to stop recursion
mock_graph.get_incoming_edges.return_value = []

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

In this test (and similarly in test_skip_branch_paths...), analyze_edge_states isn’t configured, so it returns a MagicMock and edge_states["has_unknown"] will be truthy, causing propagate_skip_from_edge to return immediately. That means these tests can pass without actually exercising the intended skip-propagation path.

Other Locations
  • api/tests/unit_tests/core/workflow/graph_engine/graph_traversal/test_skip_propagator.py:172

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

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.

1 participant